I'm using filebeat and elasticsearch 7.5.0, installed via Elastic's helm charts.
I'm trying to get ES and Filebeat set up in such a way that I can stand up a new cluster inside kubernetes and have everything Just Work. I'm running into an issue where I'm setting the ILM policy via filebeat config with the default index pattern of filebeat-7.5.0-%{now/d}-000001
but instead the index gets the name filebeat-7.5.0
and that seems to ruin the ILM setup, as the index template doesn't match (it's looking for filebeat-7.5.0-*
) and thus the ILM policy doesn't get applied to the index. It would also probably have issues rolling over as the write alias has the same name as a concrete index.
Index Template and ILM policy get created correctly, as far as I can tell.
index-management logs from filebeat startup:
2019-12-19T09:10:58.100Z INFO [index-management] idxmgmt/std.go:256 Auto ILM enable success.
2019-12-19T09:10:58.239Z INFO [index-management] idxmgmt/std.go:269 ILM policy successfully loaded.
2019-12-19T09:10:58.240Z INFO [index-management] idxmgmt/std.go:408 Set setup.template.name to '{filebeat-7.5.0 %{now/d}-000001}' as ILM is enabled.
2019-12-19T09:10:58.240Z INFO [index-management] idxmgmt/std.go:413 Set setup.template.pattern to 'filebeat-7.5.0-*' as ILM is enabled.
2019-12-19T09:10:58.240Z INFO [index-management] idxmgmt/std.go:447 Set settings.index.lifecycle.rollover_alias in template to {filebeat-7.5.0 %{now/d}-000001} as ILM is enabled.
2019-12-19T09:10:58.240Z INFO [index-management] idxmgmt/std.go:451 Set settings.index.lifecycle.name in template to {filebeat-7.5.0 {"policy":{"phases":{"delete":{"actions":{"delete":{}},"min_age":"6d"},"hot":{"
actions":{"rollover":{"max_age":"1d","max_size":"1gb"},"set_priority":{"priority":100}},"min_age":"0ms"}}}}} as ILM is enabled.
2019-12-19T09:10:58.312Z INFO template/load.go:89 Template filebeat-7.5.0 already exists and will not be overwritten.
2019-12-19T09:10:58.312Z INFO [index-management] idxmgmt/std.go:293 Loaded index template.
2019-12-19T09:10:58.312Z INFO [index-management] idxmgmt/std.go:304 Write alias successfully generated.
Filebeat config:
filebeat.inputs:
...
setup.ilm:
enabled: true
policy_file: ilm_policy.json
policy_name: filebeat-%{[agent.version]}
pattern: "%{now/d}-000001"
check_exists: false
overwrite: true
output.elasticsearch:
host: '${NODE_NAME}'
hosts: '${ELASTICSEARCH_HOSTS:es-master:9200}'
ilm_policy.json:
{
"policy" : {
"phases" : {
"hot" : {
"min_age" : "0ms",
"actions" : {
"rollover" : {
"max_size" : "1gb",
"max_age" : "1d"
},
"set_priority" : {
"priority" : 100
}
}
},
"delete" : {
"min_age" : "6d",
"actions" : {
"delete" : { }
}
}
}
}
}
Any ideas what I'm doing wrong?