I’ve created the following policy based on the demo policy in the docs.
curl --cacert config/ca.pem -X PUT "https://localhost:9200/_opendistro/_ism/policies/hot_warm_delete" -H 'Content-Type: application/json' -d'
{
"policy": {
"policy_id": "hot_warm_delete",
"description": "hot warm delete workflow",
"last_updated_time": 1592427149559,
"schema_version": 1,
"error_notification": {
"destination": {
"slack": {
"url": "https://hooks.slack.com/services/OMITTED"
}
},
"message_template": {
"source": "There was an error on index {{ctx.index}}",
"lang": "mustache"
}
},
"default_state": "hot",
"states": [{
"name": "hot",
"actions": [{
"rollover": {
"min_index_age": "1d"
}
}],
"transitions": [{
"state_name": "warm"
}]
},
{
"name": "warm",
"actions": [{
"replica_count": {
"number_of_replicas": 5
}
}],
"transitions": [{
"state_name": "delete",
"conditions": {
"min_index_age": "1d"
}
}]
},
{
"name": "delete",
"actions": [{
"notification": {
"destination": {
"slack": {
"url": "https://hooks.slack.com/services/OMITTED"
}
},
"message_template": {
"source": "The index {{ctx.index}} is being deleted",
"lang": "mustache"
}
}
},
{
"delete": {}
}
],
"transitions": []
}
]
}
}
'
I’ve also created a template which (from my understanding) will allow an index matching the template’s configured index pattern to automatically get assigned to the management policy with the template’s rollover_alias.
curl --cacert config/ca.pem -X POST "https://localhost:9200/_template/syslog" -H 'Content-Type: application/json' -d'
{
"aliases": {},
"index_patterns": ["syslog-20*"],
"settings": {
"opendistro.index_state_management.policy_id": "hot_warm_delete",
"opendistro.index_state_management.rollover_alias": "syslog"
}
}'
And then I’ve created the necessary alias:
curl --cacert config/ca.pem -X POST "https://localhost:9200/_aliases" -H 'Content-Type: application/json' -d'
{
"actions": [
{
"add": {
"index": "syslog-20*",
"alias": "syslog"
}
}
]
}
'
New indexes are created based on timestamp (ie. syslog-2020.06.24) which match the index pattern, and I can see the index being managed. It will initialize successfully, but stays in a “attempting to rollover” state.
What am I doing wrong here? I’ve scoured the forums and the docs but I can’t tell where I’m going wrong. Some help would be much appreciated!