Deleting indexes with ILM Policy and Index Template

Elasticsearch: 7.6.2, Kibana: Kibana:7.6.2
As given in the Tutorial: Automate rollover with ILM. I tried to create an ILM Policy and a simple Index template with two index pattern as given below

url: /_ilm/policy/efk_policy
method: PUT
payload: {"policy": {"phases": {"delete": {"min_age": "1h", "actions": {"delete": {}}}}}})

and template

url: /_template/efk_policy_template
method: PUT
payload: {"index_patterns": ["services*", "pipelines*"], "settings": {"": policy_name}}

Which Gives Me following

Service Index Which has no policy being attached


And There was no Index attached to policy also

But Same when i did with Kibana add API /kibana/api/index_lifecycle_management/index/add , it was working fine. Am I missing something?

I think if index is already created then you have to go assign this ILM to that index.
go to setting, index management, check box index services and manage index drop down last one is add index lifecyle policy

The issue with that approach, if all logs get deleted on particular index, that index is removed from that policy. For eg. If my pipeline index has logs that is generated very rarely consider it once a week , then when ilm policy delete that Index, it also get detached from that policy, i was wondering when the same Index will be populated again after another week, will that Index have that policy being attached there.

If the index pattern matches what is defined in the policy, then it'll inherit it.

The index pattern i think matches already as services can match with services* as shown in the image but i cant see any action on the indexes, also shown in the image. does there is delay while indexes being updated by the policy?

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