# Auto Deletion of Old index

**URL:** <https://discuss.elastic.co/t/auto-deletion-of-old-index/293978>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [January 11, 2022, 7:10am UTC](https://discuss.elastic.co/t/auto-deletion-of-old-index/293978 "2022-01-11T07:10:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![triptesh1212](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/triptesh1212/32/97534_2.png) [@triptesh1212](https://discuss.elastic.co/u/triptesh1212)\
**Post date:** [January 11, 2022, 7:10am UTC](https://discuss.elastic.co/t/auto-deletion-of-old-index/293978/1 "2022-01-11T07:10:37Z")

</div>

Hi community,  
I am exploring the index lifecycle policy and auto deletion of an index. I have gone through the following [link](https://www.linkedin.com/pulse/how-create-index-lifecycle-policy-elasticsearch-hakan-karaoguz).

I have understood that we can create index template with policy where we can setup parameters like max\_size , min\_age for deletion for an index. And all the index with given index-pattern of the template obey that policy.

For our specific use case, We have defined index-pattern like (logs-test-\*) in the template and our index are like (logs-test-2021.12.10, logs-test-2021.12.11, … , logs-test-2021.12.15). Is there any way to create policy or any setting in index template such that only the older index like (logs-test-2021.12.10) is deleted when total size of all index (logs-test-2021.12.10, logs-test-2021.12.11 … logs-test-2021.12.15) greater than some threshold lets say 20 GB.

Thanks,  
Triptesh

---

<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:** [January 11, 2022, 8:17am UTC](https://discuss.elastic.co/t/auto-deletion-of-old-index/293978/2 "2022-01-11T08:17:42Z")

</div>

> [@triptesh1212](#):
>
> when total size of all index (logs-test-2021.12.10, logs-test-2021.12.11 … logs-test-2021.12.15) greater than some threshold lets say 20 GB.

That's not something that ILM can do, no.

---

<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:** [February 8, 2022, 8:18am UTC](https://discuss.elastic.co/t/auto-deletion-of-old-index/293978/3 "2022-02-08T08:18:27Z")

</div>

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