If I define multiple ILM Policies on patterns that match the same index, which one applies? Does the one with the lower "min_age" apply or the one which was created first? Or anything else?
Example:
If I now create the index "test-index" it is matched by both policies. Is it deleted after 1h or 2h?
PUT _ilm/policy/ilm_1h
{
"policy": {
"phases": {
"hot": {
"min_age": "0ms",
"actions": {
"set_priority": {
"priority": 100
}
}
},
"delete": {
"min_age": "1h",
"actions": {
"delete": {}
}
}
}
}
}
PUT _ilm/policy/ilm_2h
{
"policy": {
"phases": {
"hot": {
"min_age": "0ms",
"actions": {
"set_priority": {
"priority": 100
}
}
},
"delete": {
"min_age": "2h",
"actions": {
"delete": {}
}
}
}
}
}
PUT _template/template_1h
{
"index_patterns": ["test-*"],
"settings": {
"index.lifecycle.name": "ilm_1h"
}
}
PUT _template/template_2h
{
"index_patterns": ["test-index"],
"settings": {
"index.lifecycle.name": "ilm_2h"
}
}