# ILM - How to configure to delete indexes older than 24 hours?

**URL:** <https://discuss.elastic.co/t/ilm-how-to-configure-to-delete-indexes-older-than-24-hours/202941>\
**Category:** Kibana\
**Tags:** ilm-index-lifecycle-management\
**Created:** [October 10, 2019, 4:43am UTC](https://discuss.elastic.co/t/ilm-how-to-configure-to-delete-indexes-older-than-24-hours/202941 "2019-10-10T04:43:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Divit\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/divit_sharma/32/32348_2.png) [@Divit\_Sharma](https://discuss.elastic.co/u/Divit_Sharma)\
**Post date:** [October 10, 2019, 4:43am UTC](https://discuss.elastic.co/t/ilm-how-to-configure-to-delete-indexes-older-than-24-hours/202941/1 "2019-10-10T04:43:57Z")

</div>

Hello,

I have indexes getting generated from logstash in below format :

indexname-yyyy-mm-dd and so on...

I want to set up index lifecycle management so that index older than a day gets deleted. How to achieve that ? I used ILM in kibana to setup a policy to activate delete phase for 24 hours. But the thing is I have to assign this policy to every single indexes manually like indexname-2019-10-10, indexname-2019-10-09, indexname-2019-10-08 etc To all these indexes I have to assign this policy manually. I mean whats the use then, I can just delete the older indexes manually.

---

<div class="post-metadata">

**Author:** ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)\
**Post date:** [October 10, 2019, 8:46pm UTC](https://discuss.elastic.co/t/ilm-how-to-configure-to-delete-indexes-older-than-24-hours/202941/2 "2019-10-10T20:46:32Z")

</div>

You will want to update your index template which is responsible for managing the settings/mappings of those rolling indices to include the `index.lifecycle.name`.

[https://www.elastic.co/guide/en/elasticsearch/reference/7.4/getting-started-index-lifecycle-management.html](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/getting-started-index-lifecycle-management.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 7, 2019, 8:46pm UTC](https://discuss.elastic.co/t/ilm-how-to-configure-to-delete-indexes-older-than-24-hours/202941/3 "2019-11-07T20:46:38Z")

</div>

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