Can Index Lifecycle policies be defined on index patterns instead of Exact Index?

Hi,

Currently we can define ILM policy at index level. This creates issues for daily/weekly indexes (eg: logstash) wherein the policy has to be assigned to newly created index as well.
Can we apply Index Lifecycle policies be defined on index patterns instead of Exact Index?
Alternatively, can ILM policy be assigned to indexes using Elasticsearch templates?

ILM policies can be assigned to indices using ES templates (that's the way that our internal indices use them), and in fact its recommended to use them that way. You can add a template for something like metricbeat-* with the index.lifecycle.name and index.lifecycle.rollover_alias settings defined within the template.

Note that the first index requires a bit more setting up, since the alias has to be created and the write flag correctly set. This bootstrapping is something we're working on making easier to do.

Thanks @dakrone, the solution works perfectly fine. We would like to have the capability to assign ILM policies to indexes using index patterns in the future.

We're currently working on the infrastructure to allow this, called "Data Streams": https://github.com/elastic/elasticsearch/issues/53100

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.