# ILM policy not working

**URL:** https://discuss.elastic.co/t/ilm-policy-not-working/302604
**Category:** Kibana
**Tags:** ilm-index-lifecycle-management
**Created:** [April 18, 2022, 9:43am UTC](https://discuss.elastic.co/t/ilm-policy-not-working/302604 "2022-04-18T09:43:06Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![jisha](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@jisha](https://discuss.elastic.co/u/jisha)
#### Post date: [April 18, 2022, 9:43am UTC](https://discuss.elastic.co/t/ilm-policy-not-working/302604/1 "2022-04-18T09:43:07Z")

</div>

Hi,  
I am using elk version 8.0.0 in windows OS. There is totally 3 elk nodes 2 logstash and 1 kibana nodes .  
The ILM is not working based on the duration i set (ex:5mints,the data is not getting deleted).I have created ILM template and assigned metricbeat 8.0.0 or metricbeat-\*(tried with both) but data deletion is not happening.  
There is no error in all 3 Elasticsearch nodes logs and in kibana also and it's showing success while i click on the save policy.

Below is the source code which i implemented from my end (which is not working):  
PUT \_ilm/policy/metricbeat  
{  
"policy": {  
"phases": {  
"hot": {  
"min\_age": "0ms",  
"actions": {  
"set\_priority": {  
"priority": 100  
}  
}  
},  
"delete": {  
"min\_age": "5m",  
"actions": {  
"delete": {  
"delete\_searchable\_snapshot": true  
}  
}  
}  
}  
}  
}

---

<div class="post-metadata">

### Author: ![sudhagar\_ramesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sudhagar_ramesh/32/105673_2.png) [@sudhagar\_ramesh](https://discuss.elastic.co/u/sudhagar_ramesh)
#### Post date: [April 18, 2022, 11:57am UTC](https://discuss.elastic.co/t/ilm-policy-not-working/302604/2 "2022-04-18T11:57:08Z")

</div>

Hello @jisha

if you are applying ILM for existing indices

> **[Manage existing indices | Elasticsearch Guide \[master\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-with-existing-indices.html)**

---

<div class="post-metadata">

### Author: ![jisha](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@jisha](https://discuss.elastic.co/u/jisha)
#### Post date: [April 19, 2022, 8:12am UTC](https://discuss.elastic.co/t/ilm-policy-not-working/302604/3 "2022-04-19T08:12:51Z")

</div>

Hi Sudhagar,  
I want to apply ILM for the upcoming indices cases.

---

<div class="post-metadata">

### Author: ![sudhagar\_ramesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sudhagar_ramesh/32/105673_2.png) [@sudhagar\_ramesh](https://discuss.elastic.co/u/sudhagar_ramesh)
#### Post date: [May 15, 2022, 5:40am UTC](https://discuss.elastic.co/t/ilm-policy-not-working/302604/4 "2022-05-15T05:40:26Z")

</div>

Hello @jisha

The below are the steps: (old method)  
1.Create policy  
2.Create index template  
3.Add policy to index template

the new method is to try in kibana where we have the rollover of data from hot,warm and cold in UI , post which you would be getting the code

---

<div class="post-metadata">

### Author: ![sudhagar\_ramesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sudhagar_ramesh/32/105673_2.png) [@sudhagar\_ramesh](https://discuss.elastic.co/u/sudhagar_ramesh)
#### Post date: [May 18, 2022, 12:00pm UTC](https://discuss.elastic.co/t/ilm-policy-not-working/302604/5 "2022-05-18T12:00:13Z")

</div>

@jisha Could you please provide update on this topic

---

<div class="post-metadata">

### Author: ![jisha](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@jisha](https://discuss.elastic.co/u/jisha)
#### Post date: [May 27, 2022, 11:22am UTC](https://discuss.elastic.co/t/ilm-policy-not-working/302604/6 "2022-05-27T11:22:42Z")

</div>

@sudhagar_ramesh The issue got resolved . I added below POST remove (executed it first)and PUT command (Run it).  
POST /\_ilm/remove # to remove ILM policy and reapply it  
PUT mylogs-pre-ilm\*/\_settings {"index": {"lifecycle": {"name": "mylogs\_policy\_existing"}}}

---

<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: [June 24, 2022, 11:23am UTC](https://discuss.elastic.co/t/ilm-policy-not-working/302604/7 "2022-06-24T11:23:18Z")

</div>

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