# Index rollover / Delete indexes

**URL:** <https://discuss.elastic.co/t/index-rollover-delete-indexes/300685>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [March 25, 2022, 10:38am UTC](https://discuss.elastic.co/t/index-rollover-delete-indexes/300685 "2022-03-25T10:38:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![humartinez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/humartinez/32/46395_2.png) [@humartinez](https://discuss.elastic.co/u/humartinez)\
**Post date:** [March 25, 2022, 10:38am UTC](https://discuss.elastic.co/t/index-rollover-delete-indexes/300685/1 "2022-03-25T10:38:02Z")

</div>

Hi,  
I have a kind of wierd question. I just want to know if there is a way using index rollover and the index lifecycle to lets say to allways keep the last 3 indexes.

Ej

Lets say I have a rollover policy that rolls my index after 30GBs

I'll have an alias my-index and the real indices will be ..  
my-index.0001, my-index.0002 and my-index.0003

Then when at the next roll over I will have

my-index.0001, my-index.0002, my-index.0003, my-index.0004

At this point I need to delete my-index.0001 regardless the age of the index.  
Is there a way to do this? With ILM you can but it depends on the age of the index, and I just need the last 3 or n index online

Thanks in advance

---

<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:** [March 27, 2022, 11:44pm UTC](https://discuss.elastic.co/t/index-rollover-delete-indexes/300685/2 "2022-03-27T23:44:49Z")

</div>

There's not a way to currently do that, no.

It'd be worth checking if there's a feature request to do that and add your vote to it, or create a new FR.

---

<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:** [April 24, 2022, 11:45pm UTC](https://discuss.elastic.co/t/index-rollover-delete-indexes/300685/3 "2022-04-24T23:45:17Z")

</div>

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