Older indices are not getting deleted after rollover

i did the following steps

  1. created an ilm policy.
  2. created an index template and attached the ilm policy to it.
  3. finally created an index using create index API.
    when i checked the index under index management section in kibana, the ilm policy that i created was attached to the index and the index started to rollover to a new index after a few minutes. But the problem here is older indices are not getting deleted.
    below is my ilm policy,
    PUT _ilm/policy/tmmt
    {
    "policy": {
    "phases": {
    "hot": {
    "min_age": "0ms",
    "actions": {
    "rollover": {
    "max_size": "50gb",
    "max_age": "5m",
    "max_docs": 5
    },
    "set_priority": {
    "priority": 100
    }
    }
    },
    "warm": {
    "min_age": "3m",
    "actions": {
    "set_priority": {
    "priority": 50
    }
    }
    },
    "delete": {
    "min_age": "1m",
    "actions": {}
    }
    }
    }
    }
    below is the summary of my index,
    index-deletion-error

please help :slightly_smiling_face:

You need an additional delete under actions, then you should be ok.

i have already enabled delete phase @warkolm

i got it @warkolm , it should be like the below code i think. i added the delete under actions manually here and created a new policy using ILM API. i am wondering why that delete was not automatically added when i created the ilm policy using Kibana UI ??

PUT _ilm/policy/tmmt1
{
"policy": {
"phases": {
"hot": {
"min_age": "0ms",
"actions": {
"rollover": {
"max_size": "50gb",
"max_age": "5m",
"max_docs": 5
},
"set_priority": {
"priority": 100
}
}
},
"warm": {
"min_age": "3m",
"actions": {
"set_priority": {
"priority": 50
}
}
},
"delete": {
"min_age": "1m",
"actions": {
"delete": {}
}
}
}
}
}

There is/was a bug in Kibana that didn't add this action.

1 Like

thank you for your time and help @warkolm :smiley:

1 Like