# ILM policies conditions are getting exceeded to rollover the indices

**URL:** https://discuss.elastic.co/t/ilm-policies-conditions-are-getting-exceeded-to-rollover-the-indices/312308
**Category:** Kibana
**Tags:** ilm-index-lifecycle-management
**Created:** [August 17, 2022, 4:16pm UTC](https://discuss.elastic.co/t/ilm-policies-conditions-are-getting-exceeded-to-rollover-the-indices/312308 "2022-08-17T16:16:50Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Mangesh\_Mathe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mangesh_mathe/32/103371_2.png) [@Mangesh\_Mathe](https://discuss.elastic.co/u/Mangesh_Mathe)
#### Post date: [August 17, 2022, 4:16pm UTC](https://discuss.elastic.co/t/ilm-policies-conditions-are-getting-exceeded-to-rollover-the-indices/312308/1 "2022-08-17T16:16:50Z")

</div>

Hello Elastic Team,

I have applied ILM policy(test) to my Index(timeseries) where I have defined ONLY hot phase with conditions max\_age(15m) & max\_docs(5).  
My index is getting rollover but not following/matching above conditions strictly.  
It always exceeds the max\_age & max\_docs with indices name as 00001,00002,00003...so on  
**Expected behavior** : Any of the conditions(either max\_age or max\_docs) should match and once it matched it should rollover the index.

```auto
#==> ILM policy <============================
PUT _ilm/policy/test
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "rollover": {
            "max_age": "15m",
            "max_docs":5
          },
          "set_priority": {
            "priority": 100
          }
        }
      }
    }
  }
}
#==> Index Template <=========================
PUT _index_template/timeseries_template
{
  "index_patterns": ["timeseries-*"], 
  "template":{
    "settings": {
      "number_of_shards": 1,
      "number_of_replicas": 1,
      "index.lifecycle.name": "test",      
      "index.lifecycle.rollover_alias": "timeseries"
  }
}
}
#==> Write aliases<===========================

PUT timeseries-000001
{
  "aliases": {
    "timeseries": {
      "is_write_index": true
    }
  }
}
#==> To check the ILM actions<=================

GET timeseries-*/_ilm/explain

#==> sending data into Index <=================
POST timeseries/_doc
{
"name":"mangesh",
"birthdate":"1993-06-01"
}

POST timeseries/_doc
{
"name":"pankaj",
"birthdate":"1994-10-01"
}
==============================================

```

Is there any default minimum value for the fields max\_age & max\_docs in elasticsearch? If not then please suggest on this.  
Help me to correct if there is anything wrong with my queries.

Thank you!

---

<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: [August 22, 2022, 12:34am UTC](https://discuss.elastic.co/t/ilm-policies-conditions-are-getting-exceeded-to-rollover-the-indices/312308/2 "2022-08-22T00:34:47Z")

</div>

Welcome to our community! 😃

ILM runs a check every 10 minutes, by default, to see if indices need actions applied to them. Your conditions are too small to be able to accurately rollover unfortunately.

---

<div class="post-metadata">

### Author: ![Mangesh\_Mathe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mangesh_mathe/32/103371_2.png) [@Mangesh\_Mathe](https://discuss.elastic.co/u/Mangesh_Mathe)
#### Post date: [August 22, 2022, 11:37am UTC](https://discuss.elastic.co/t/ilm-policies-conditions-are-getting-exceeded-to-rollover-the-indices/312308/3 "2022-08-22T11:37:12Z")

</div>

Understood. Thank you!

---

<div class="post-metadata">

### Author: ![Mangesh\_Mathe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mangesh_mathe/32/103371_2.png) [@Mangesh\_Mathe](https://discuss.elastic.co/u/Mangesh_Mathe)
#### Post date: [August 22, 2022, 11:45am UTC](https://discuss.elastic.co/t/ilm-policies-conditions-are-getting-exceeded-to-rollover-the-indices/312308/4 "2022-08-22T11:45:21Z")

</div>

Can you please tell me , what if I want to rollover my indices on monthly basis.  
I want to generate rollover indices for SEPT...OCT...NOV...DEC  
I know we can use **"max\_age":"30d"** for that , but it will create problem for the months having 31 days & 28 days in a year.

```auto
 "actions": {
          "rollover": {
            "max_age": "(Monthly)",

```

---

<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: [August 22, 2022, 9:20pm UTC](https://discuss.elastic.co/t/ilm-policies-conditions-are-getting-exceeded-to-rollover-the-indices/312308/5 "2022-08-22T21:20:24Z")

</div>

ILM doesn't support that type of date math, you might want to make a feature request for it though.

---

<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: [September 19, 2022, 9:21pm UTC](https://discuss.elastic.co/t/ilm-policies-conditions-are-getting-exceeded-to-rollover-the-indices/312308/6 "2022-09-19T21:21:12Z")

</div>

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