# MY ILM policy is not deleting old data

**URL:** <https://discuss.elastic.co/t/my-ilm-policy-is-not-deleting-old-data/321628>\
**Category:** Kibana\
**Tags:** ilm-index-lifecycle-management\
**Created:** [December 20, 2022, 9:58am UTC](https://discuss.elastic.co/t/my-ilm-policy-is-not-deleting-old-data/321628 "2022-12-20T09:58:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Naga\_Prudhvi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/naga_prudhvi/32/99501_2.png) [@Naga\_Prudhvi](https://discuss.elastic.co/u/Naga_Prudhvi)\
**Post date:** [December 20, 2022, 9:58am UTC](https://discuss.elastic.co/t/my-ilm-policy-is-not-deleting-old-data/321628/1 "2022-12-20T09:58:11Z")

</div>

My old data is not deleting don't know why  
PUT \_ilm/policy/prudhviilm  
{  
"policy": {  
"phases": {  
"hot": {  
"min\_age": "0ms",  
"actions": {  
"rollover": {  
"max\_age": "5m"  
}  
}  
},  
"warm": {  
"min\_age": "5m",  
"actions": {}  
},  
"cold": {  
"min\_age": "8m",  
"actions": {}  
},  
"delete": {  
"min\_age": "14m",  
"actions": {  
"delete": {}  
}  
}  
}  
}  
}

PUT \_component\_template/prudhvicomponent  
{  
"template": {  
"settings": {  
"number\_of\_replicas": 1,  
"number\_of\_shards": 1,  
"index.lifecycle.name": "prudhviilm"  
}  
}  
}

GET \_data\_stream/pru-dec-2022  
{  
"data\_streams": [  
{  
"name": "pru-dec-2022",  
"timestamp\_field": {  
"name": "@timestamp"  
},  
"indices": [  
{  
"index\_name": ".ds-pru-dec-2022-2022.12.20-000002",  
"index\_uuid": "gFUMXHcLTdGFA43eYMACTw"  
},  
{  
"index\_name": ".ds-pru-dec-2022-2022.12.20-000003",  
"index\_uuid": "hRbD9hiWTKSyDj2N-T40Lw"  
}  
],  
"generation": 4,  
"status": "GREEN",  
"template": "logs-index-template",  
"ilm\_policy": "prudhviilm",  
"hidden": false,  
"system": false,  
"allow\_custom\_routing": false,  
"replicated": false  
}  
]  
}

PUT \_index\_template/logs-index-template  
{  
"index\_patterns": ["pru-_-_"],  
"data\_stream": { },  
"composed\_of": ["prudhvicomponent"]  
}

POST pru-dec-2022/\_doc  
{  
"@timestamp":"2022-12-20T09:20:07.000Z",  
"message": "I am logged"  
}

POST pru-dec-2022/\_doc  
{  
"@timestamp":"1671528152378",  
"message": "I am logged"  
}

---

<div class="post-metadata">

**Author:** ![Venkata\_Raja](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/venkata_raja/32/114264_2.png) [@Venkata\_Raja](https://discuss.elastic.co/u/Venkata_Raja)\
**Post date:** [December 20, 2022, 12:59pm UTC](https://discuss.elastic.co/t/my-ilm-policy-is-not-deleting-old-data/321628/2 "2022-12-20T12:59:26Z")

</div>

Can you try using ILM explain API to see the error?

> **[Explain lifecycle API | Elasticsearch Guide \[8.5\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html)**

---

<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:** [January 17, 2023, 1:00pm UTC](https://discuss.elastic.co/t/my-ilm-policy-is-not-deleting-old-data/321628/3 "2023-01-17T13:00:18Z")

</div>

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