# Delete index policy for every X minutes

**URL:** https://discuss.elastic.co/t/delete-index-policy-for-every-x-minutes/356805
**Category:** Elasticsearch
**Created:** [April 4, 2024, 5:15pm UTC](https://discuss.elastic.co/t/delete-index-policy-for-every-x-minutes/356805 "2024-04-04T17:15:33Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mpniel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mpniel/32/113170_2.png) [@mpniel](https://discuss.elastic.co/u/mpniel)
#### Post date: [April 4, 2024, 5:15pm UTC](https://discuss.elastic.co/t/delete-index-policy-for-every-x-minutes/356805/1 "2024-04-04T17:15:33Z")

</div>

What is the Kibana Api command to create a delete index policy for every X minutes to a group of indexes with name starting string indA ?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [April 4, 2024, 5:22pm UTC](https://discuss.elastic.co/t/delete-index-policy-for-every-x-minutes/356805/2 "2024-04-04T17:22:53Z")

</div>

I am afraid it is not clear to me what you are looking for. It would help if you could provide some more information about your use case and what you are looking to achieve. It is also always good practice to provide information bout which version of the Elastic stack you are using.

---

<div class="post-metadata">

### Author: ![mpniel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mpniel/32/113170_2.png) [@mpniel](https://discuss.elastic.co/u/mpniel)
#### Post date: [April 4, 2024, 5:27pm UTC](https://discuss.elastic.co/t/delete-index-policy-for-every-x-minutes/356805/3 "2024-04-04T17:27:13Z")

</div>

I need the command to create ILM automatic delete of a group of indexes every X minutes.  
Using version 7.5.

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [April 4, 2024, 5:39pm UTC](https://discuss.elastic.co/t/delete-index-policy-for-every-x-minutes/356805/4 "2024-04-04T17:39:08Z")

</div>

> [@mpniel](#):
>
> Using version 7.5.

That is a very old version that has been EOL for quite some time. I would recommend that you upgrade to at least 7.17.

ILM policies are created in Elasticsearch. Have you looked at [the API for this](https://www.elastic.co/guide/en/elasticsearch/reference/8.13/index-lifecycle-management-api.html)?

> [@mpniel](#):
>
> I need the command to create ILM automatic delete of a group of indexes every X minutes.

This does not necessarily sound like what ILM was designed for. Could you please elaborate on your indexing and deletion strategy?
