Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support date math in index names for all index based apis #12059

Closed
martijnvg opened this issue Jul 6, 2015 · 3 comments
Closed

Support date math in index names for all index based apis #12059

martijnvg opened this issue Jul 6, 2015 · 3 comments
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates >feature v2.0.0-beta1

Comments

@martijnvg
Copy link
Member

Very often it is useful to query indices within a particular timeframe. For example in the case of weekly indices all the indices of the last month. This can be achieved via aliases, however this does require that something is updating the aliases each time new indices get introduced. Also when the search request (or part of the search request) is stored elsewhere already updating the search request and the alias itself isn't straight forward, because now the search request needs to be maintained in two places.

Instead it would be better if date math is supported in the index names option for all index based apis (search, index, percolate etc.). By adding support for the following format in index names:

<static_name{date_math_expr{optional_date_format}}>

The following index names can be specified:

  • <logstash-{now/d}> translates into logstash-2024.03.22
  • <logstash-{now/M}> translates into logstash-2024.03.01
  • <logstash-{now/M{YYYY.MM}}> translates into logstash-2024.03
  • <logstash-{now/M-1M{YYYY.MM}}> translates into logstash-2024.02

The data math expressions should be resolved before wildcard expressions are resolved during the concrete index name resolution.

Before this feature can be added the code that currently exists for index name wildcard expansions, index to concrete index resolutions should be refactored first to support this nicely without hacks. See #12058.

@nik9000
Copy link
Member

nik9000 commented Jul 13, 2015

Very cute.

@clintongormley clintongormley added the :Data Management/Indices APIs APIs to create and manage indices and templates label Jul 14, 2015
@ricardojohnny
Copy link

Can anyone tell me how to proceed or the name of an index is like:

"logstash-september-000009"
"logstash-october-000010"
"logstash-november-000011"

This applies to the "provided_name" of the monthly index lifecycle.

@gwbrown
Copy link
Contributor

gwbrown commented Nov 12, 2019

@ricardojohnny This appears to be a user question, and we'd like to direct these kinds of things to the forums. If you can stop by there, we'd appreciate it. This allows us to use GitHub for verified bug reports, feature requests, and pull requests.

There's an active community in the forums that should be able to help get an answer to your question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates >feature v2.0.0-beta1
Projects
None yet
Development

No branches or pull requests

5 participants