Hi,
I created a policy which will delete an index older than 7 days.I applied policy in index older than 7 days and it was deleted working fine.
Policy-
PUT _opendistro/_ism/policies/delete
{
"policy": {
"description": "A simple default policy that deletes the data older than 7days to purge security audit index.",
"last_updated_time": 1615874912379,
"schema_version": 1,
"error_notification": null,
"default_state": "hot",
"states": [
{
"name": "hot",
"actions": [],
"transitions": [
{
"state_name": "delete",
"conditions": {
"min_index_age": "7d"
}
}
]
},
{
"name": "delete",
"actions": [
{
"delete": {}
}
],
"transitions": []
}
]
}
}
I created template to apply policy on index “security-auditlog-*”, but I am getting error.
PUT _index_template/security_delete
{
"index_patterns": [
"security-auditlog-*"
],
"template": {
"settings": {
"opendistro.index_state_management.policy_id": "delete"
}
}
}
Error-
{
"error" : "Incorrect HTTP method for uri [/_index_template/%3Ctemplate_name%3E?pretty=true] and method [PUT], allowed: [POST]",
"status" : 405
}