# Can ILM policy be created on an existing set of indexes?

**URL:** https://discuss.elastic.co/t/can-ilm-policy-be-created-on-an-existing-set-of-indexes/340809
**Category:** Elasticsearch
**Tags:** ilm-index-lifecycle-management
**Created:** [August 15, 2023, 6:34am UTC](https://discuss.elastic.co/t/can-ilm-policy-be-created-on-an-existing-set-of-indexes/340809 "2023-08-15T06:34:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ong/32/40766_2.png) [@Ong](https://discuss.elastic.co/u/Ong)
#### Post date: [August 15, 2023, 6:34am UTC](https://discuss.elastic.co/t/can-ilm-policy-be-created-on-an-existing-set-of-indexes/340809/1 "2023-08-15T06:34:49Z")

</div>

Currently, i am have a FluentD daemon writing app logs to Elasticsearch. The index names have the naming convention "logstash-(date)" e.g. logstash-2023-08-15.

Is it possible to create an ILM policy that applies to these existing indexes and any new ones created?

I read from the ES documentation that the index name has to end with a rolling number hence i am not sure if ILM can be applied to indexes with the naming convention above.

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [August 15, 2023, 12:42pm UTC](https://discuss.elastic.co/t/can-ilm-policy-be-created-on-an-existing-set-of-indexes/340809/2 "2023-08-15T12:42:39Z")

</div>

> [@Ong](#):
>
> Is it possible to create an ILM policy that applies to these existing indexes and any new ones created?

It really depends on what you want the ILM policy to do.

If you have daily indices and you want to move those indices to a different data tier, e.g. from hot nodes to warm nodes, or just delete the indices after a specific amount of days, than you just need to create the ILM policy with those actions set this policy in your current indices and change your template so this policy is applied to now indices.

But if you want the ILM to automatically rollover your indices after some days or when it reach some specific size, then you will need to change the way you index your data.

> [@Ong](#):
>
> I read from the ES documentation that the index name has to end with a rolling number

This only applies when you want to use the rollover option of the ILM policy, if you want to keep creating daily indices you turn-off the rollover and the ILM policy will work for the other actions (move indices and delete).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 12, 2023, 12:43pm UTC](https://discuss.elastic.co/t/can-ilm-policy-be-created-on-an-existing-set-of-indexes/340809/3 "2023-09-12T12:43:17Z")

</div>

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