# Delete oldest index if storage is full

**URL:** https://discuss.elastic.co/t/delete-oldest-index-if-storage-is-full/301115
**Category:** Elasticsearch
**Tags:** ilm-index-lifecycle-management
**Created:** [March 30, 2022, 3:26pm UTC](https://discuss.elastic.co/t/delete-oldest-index-if-storage-is-full/301115 "2022-03-30T15:26:43Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![6NMgfDwZ3](https://avatars.discourse-cdn.com/v4/letter/6/ac91a4/32.png) [@6NMgfDwZ3](https://discuss.elastic.co/u/6NMgfDwZ3)
#### Post date: [March 30, 2022, 3:26pm UTC](https://discuss.elastic.co/t/delete-oldest-index-if-storage-is-full/301115/1 "2022-03-30T15:26:43Z")

</div>

Hello,

ELK stack version: v7.x ... latest

I've created an ILM policy that deletes the `index` if the index is older than x days. It works well.

But sometimes too many `documents` arrive into the `indexes` so the storage becomes full (95%) before the policy would delete the oldest index to make space for the more valuable `documents` in the newer `indexes`.

Is there any kind of mechanism in ELK which would help to delete the oldest `index` if storage is full or reach a certain level (x%)?

if possible I'd like to solve this problem only with ELK feature set so to avoid the usage of external tools like Curator.

Could somebody point me in the right direction?

---

<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 30, 2022, 11:46pm UTC](https://discuss.elastic.co/t/delete-oldest-index-if-storage-is-full/301115/2 "2022-03-30T23:46:36Z")

</div>

That's not possible in ILM at this point sorry.

---

<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 27, 2022, 11:47pm UTC](https://discuss.elastic.co/t/delete-oldest-index-if-storage-is-full/301115/3 "2022-04-27T23:47:23Z")

</div>

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