Prior to version 1.13.0, we were attaching ISM policies to indices via the template api like below.
PUT /_template/some-index
{
"index_patterns": "example*",
"order": order,
"settings": {
"index": {
"number_of_shards": shards,
"number_of_replicas": replicas
"opendistro.index_state_management.policy_id": ism_policy
}
}
After version 1.13.0, opendistro.index_state_management.policy_id is deprecated, and we had to use ism_template like in the code snippet to achieve the same behaviour.
PUT _opendistro/_ism/policies/ism_policy
{
"policy": {
"description": "Delete index after 14d",
"default_state": "search",
"states": [
{
"name": "search",
"actions": [],
"transitions": [
{
"state_name": "delete",
"conditions": {
"min_index_age": "14d"
}
}
]
},
{
"name": "delete",
"actions": [
{
"delete": {}
}
],
"transitions": []
}
],
"ism_template": {
"index_patterns": ["example*"]
}
}
}
However, we are faced with this error when running the above command in the kibana dev tools. We tried using different priority numbers and it randomly works and errors out. Not sure why this is happening.
{
"error" : {
"root_cause" : [
{
"type" : "index_management_exception",
"reason" : "New policy short has an ISM template with index pattern [example*] matching existing policy templates, please use a different priority than 44"
}
],
"type" : "index_management_exception",
"reason" : "New policy short has an ISM template with index pattern [example*] matching existing policy templates, please use a different priority than 44",
"caused_by" : {
"type" : "exception",
"reason" : "java.lang.IllegalArgumentException: New policy short has an ISM template with index pattern [example*] matching existing policy templates, please use a different priority than 44"
}
},
"status" : 400
}