{
"policy": {
"policy_id": "delete_old",
"description": "A simple default policy that deletes old indicies.",
"default_state": "open",
"states": [
{
"name": "open",
"actions": [
{
"open": {}
}
],
"transitions": [
{
"state_name": "delete",
"conditions": {
"min_index_age": "5d"
}
}
]
},
{
"name": "delete",
"actions": [
{
"delete": {}
}
],
"transitions": []
}
]
}
}
PUT _template/template_1
{
"index_patterns" : ["index-*"],
"order" : 1,
"settings" : {
"index.opendistro.index_state_management.policy_id": "delete_old"
},
"mappings" : {
"_source" : { "enabled" : true }
}
}
{
"policy": {
"policy_id": "Delete_logstash_logs_45d",
"description": "Delete logstash indices after 45 days",
"default_state": "check_age",
"states": [
{
"name": "check_age",
"actions": [],
"transitions": [
{
"state_name": "Delete",
"conditions": {
"min_index_age": "45d"
}
}
]
},
{
"name": "Delete",
"actions": [
{
"delete": {}
}
],
"transitions": []
}
],
"ism_template": [
{
"index_patterns": [
"logstash-*"
],
"priority": 100
}
]
}
}