# Older indices are not getting deleted after rollover

**URL:** https://discuss.elastic.co/t/older-indices-are-not-getting-deleted-after-rollover/263953
**Category:** Elasticsearch
**Created:** [February 11, 2021, 5:55am UTC](https://discuss.elastic.co/t/older-indices-are-not-getting-deleted-after-rollover/263953 "2021-02-11T05:55:44Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Gokul6](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gokul6/32/84049_2.png) [@Gokul6](https://discuss.elastic.co/u/Gokul6)
#### Post date: [February 11, 2021, 5:55am UTC](https://discuss.elastic.co/t/older-indices-are-not-getting-deleted-after-rollover/263953/1 "2021-02-11T05:55:44Z")

</div>

i did the following steps

1. created an **ilm policy**.
2. created an **index template** and attached the ilm policy to it.
3. finally created an **index** using create index API.  
when i checked the index under index management section in kibana, the ilm policy that i created was attached to the index and the index started to rollover to a new index after a few minutes. But the problem here is **older indices are not getting deleted.**  
**below is my ilm policy,**  
PUT \_ilm/policy/tmmt  
{  
"policy": {  
"phases": {  
"hot": {  
"min\_age": "0ms",  
"actions": {  
"rollover": {  
"max\_size": "50gb",  
"max\_age": "5m",  
"max\_docs": 5  
},  
"set\_priority": {  
"priority": 100  
}  
}  
},  
"warm": {  
"min\_age": "3m",  
"actions": {  
"set\_priority": {  
"priority": 50  
}  
}  
},  
"delete": {  
"min\_age": "1m",  
"actions": {}  
}  
}  
}  
}  
**below is the summary of my index,**  
 ![index-deletion-error](https://us1.discourse-cdn.com/elastic/original/3X/7/8/78b50455731514f0a58ccb119187286878012a4d.png)

please help 🙂

---

<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: [February 11, 2021, 6:01am UTC](https://discuss.elastic.co/t/older-indices-are-not-getting-deleted-after-rollover/263953/2 "2021-02-11T06:01:05Z")

</div>

You need an additional `delete` under `actions`, then you should be ok.

---

<div class="post-metadata">

### Author: ![Gokul6](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gokul6/32/84049_2.png) [@Gokul6](https://discuss.elastic.co/u/Gokul6)
#### Post date: [February 11, 2021, 6:13am UTC](https://discuss.elastic.co/t/older-indices-are-not-getting-deleted-after-rollover/263953/3 "2021-02-11T06:13:24Z")

</div>

i have already enabled delete phase @warkolm

 ![delete-ilm](https://us1.discourse-cdn.com/elastic/original/3X/a/0/a0cbac7132730ee3e68798f9a741b3a9b01c9f8c.png)

---

<div class="post-metadata">

### Author: ![Gokul6](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gokul6/32/84049_2.png) [@Gokul6](https://discuss.elastic.co/u/Gokul6)
#### Post date: [February 11, 2021, 6:29am UTC](https://discuss.elastic.co/t/older-indices-are-not-getting-deleted-after-rollover/263953/4 "2021-02-11T06:29:29Z")

</div>

i got it @warkolm , it should be like the below code i think. i added the `delete` under `actions` **manually here** and created a new policy using **ILM API**. i am wondering why that delete was not automatically added when i created the ilm policy using **Kibana UI**??

PUT \_ilm/policy/tmmt1  
{  
"policy": {  
"phases": {  
"hot": {  
"min\_age": "0ms",  
"actions": {  
"rollover": {  
"max\_size": "50gb",  
"max\_age": "5m",  
"max\_docs": 5  
},  
"set\_priority": {  
"priority": 100  
}  
}  
},  
"warm": {  
"min\_age": "3m",  
"actions": {  
"set\_priority": {  
"priority": 50  
}  
}  
},  
"delete": {  
"min\_age": "1m",  
"actions": {  
"delete": {}  
}  
}  
}  
}  
}

---

<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: [February 11, 2021, 6:57am UTC](https://discuss.elastic.co/t/older-indices-are-not-getting-deleted-after-rollover/263953/5 "2021-02-11T06:57:06Z")

</div>

There is/was a bug in Kibana that didn't add this action.

---

<div class="post-metadata">

### Author: ![Gokul6](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gokul6/32/84049_2.png) [@Gokul6](https://discuss.elastic.co/u/Gokul6)
#### Post date: [February 11, 2021, 7:04am UTC](https://discuss.elastic.co/t/older-indices-are-not-getting-deleted-after-rollover/263953/6 "2021-02-11T07:04:10Z")

</div>

thank you for your time and help @warkolm 😃

---

<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: [March 11, 2021, 7:04am UTC](https://discuss.elastic.co/t/older-indices-are-not-getting-deleted-after-rollover/263953/7 "2021-03-11T07:04:47Z")

</div>

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