I have a logstash index storing data that will be used in reporting, but only ever for the last 5 minutes.
Hence, I want to have a very aggressive deletion policy.
Roll the index every 15 minutes
Delete the rolled (old) index.
However, my ILM, index template and index creation must have a flaw in it, because every time I view the ILM status of my index, my settings aren't there.
Can someone please point out where I'm going wrong?
ILM POLICY
PUT /_ilm/policy/logstash-policy
{
"policy": {
"phases": {
"hot": {
"actions": {
"rollover": {
"max_age": "15m",
"max_size": "10GB"
}
}
},
"delete": {
"min_age": "15m",
"actions": {
"delete": {}
}
}
}
}
}
INDEX TEMPLATE
PUT /_template/logstash_template
{
"index_patterns": ["logstash-*"],
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0,
"index.lifecycle.name": "logstash-policy",
"index.lifecycle.rollover_alias": "logstash-alias"
}
}
INDEX CREATION
PUT /logstash-000001
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"aliases": {
"logstash":{
"is_write_index": true
}
},
"mappings": {
<various field mappings>
}
}
And when I query the ILM settings, I don't see the things I expect.
GET logstash*/_ilm/explain?pretty
{
"indices" : {
"logstash-000001" : {
"index" : "logstash-000001",
"managed" : true,
"policy" : "logstash-policy",
"lifecycle_date_millis" : 1596507802885,
"age" : "1.16h",
"phase" : "hot",
"phase_time_millis" : 1596507802959,
"action" : "rollover",
"action_time_millis" : 1596508792079,
"step" : "check-rollover-ready",
"step_time_millis" : 1596508792079,
"phase_execution" : {
"policy" : "logstash-policy",
"phase_definition" : {
"min_age" : "0ms",
"actions" : {
"rollover" : {
"max_size" : "50gb",
"max_age" : "30d"
}
}
},
"version" : 1,
"modified_date_in_millis" : 1595979741503
}
}
}
}
The max_size and max_age values look like they came from a default somewhere.
Can someone spot where I'm going wrong?