# Automatically Applying Existing ILM Policy to Newly Created Indicies

**URL:** https://discuss.elastic.co/t/automatically-applying-existing-ilm-policy-to-newly-created-indicies/287749
**Category:** Elasticsearch
**Tags:** ilm-index-lifecycle-management
**Created:** [October 27, 2021, 5:26am UTC](https://discuss.elastic.co/t/automatically-applying-existing-ilm-policy-to-newly-created-indicies/287749 "2021-10-27T05:26:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rajsuper2021](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajsuper2021/32/81472_2.png) [@rajsuper2021](https://discuss.elastic.co/u/rajsuper2021)
#### Post date: [October 27, 2021, 5:26am UTC](https://discuss.elastic.co/t/automatically-applying-existing-ilm-policy-to-newly-created-indicies/287749/1 "2021-10-27T05:26:24Z")

</div>

I have indicies that daily created by logstash in Elasticsearch called "logstash-\*"

I have a ILM policy to clean up indicies that are 10 days old.

How do I ensure newly created indices have the ILM Policy automatically added to them?

Thanks.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [October 27, 2021, 5:38am UTC](https://discuss.elastic.co/t/automatically-applying-existing-ilm-policy-to-newly-created-indicies/287749/2 "2021-10-27T05:38:55Z")

</div>

You will need to add the policy to the Logstash template - [Manage existing indices | Elasticsearch Guide [7.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.15/ilm-with-existing-indices.html)

---

<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: [November 24, 2021, 5:39am UTC](https://discuss.elastic.co/t/automatically-applying-existing-ilm-policy-to-newly-created-indicies/287749/3 "2021-11-24T05:39:43Z")

</div>

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