# ILM policy not kicking in for index template

**URL:** <https://discuss.elastic.co/t/ilm-policy-not-kicking-in-for-index-template/308355>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [June 28, 2022, 12:38pm UTC](https://discuss.elastic.co/t/ilm-policy-not-kicking-in-for-index-template/308355 "2022-06-28T12:38:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sz7443](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@sz7443](https://discuss.elastic.co/u/sz7443)\
**Post date:** [June 28, 2022, 12:38pm UTC](https://discuss.elastic.co/t/ilm-policy-not-kicking-in-for-index-template/308355/1 "2022-06-28T12:38:22Z")

</div>

Hi all,

I seek help with problem of ILM not being applied. I am missing a bit of configuration, but I don't see which one.

I have:

- ILM policy that should delete data after 4 hours
- ILM Policy being applied to the index template meeting the names of 2 indexes where deletion should already occur days ago (see the definition and the error below)  
Settings for index template:

```auto
{
  "index": {
    "lifecycle": {
      "name": "4-hours-retention",
      "rollover_alias": "ilm-winlogbeat-rollover"
    },
    "number_of_shards": "1",
    "number_of_replicas": "0"
  }
}

```

Settings set manually to the index template covering the indices in scope:

```auto
PUT _index_template/winlogbeat_
{
  "index_patterns":["winlogbeat*"],               
  "template": {
    "settings": {
      "number_of_shards": 1,
      "number_of_replicas": 0,
      "index.lifecycle.name": "4-hours-retention",      
      "index.lifecycle.rollover_alias": "ilm-winlogbeat-rollover"    
    }
  }
}

```

... and if I check the ILM "health" of the indices:

```auto
GET winlogbeat-*/_ilm/explain

```

I get this error about rollover\_alias:

```auto
 "setting [index.lifecycle.rollover_alias] for index [winlogbeat-2022.06] is empty or not defined"

```

... which I deem odd, because I thought I am doing that with exactly this snippet that was accepted by ES:

```auto
"index.lifecycle.rollover_alias": "ilm-winlogbeat-rollover"    

```

ElasticSearch/Kibana version: 8.2.2  
Logstash version: 7.6

Thank you in advance pointing out what am I missing, take care.

---

<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:** [July 26, 2022, 12:38pm UTC](https://discuss.elastic.co/t/ilm-policy-not-kicking-in-for-index-template/308355/2 "2022-07-26T12:38:43Z")

</div>

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