ILM policies conditions are getting exceeded to rollover the indices

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.

#==> 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!

Welcome to our community! :smiley:

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.

Understood. Thank you!

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.

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

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

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