在使用filebeat7.5的時候,filebeat.yml文件中指定了index,並且也指定了template.name、template.pattern。
但是在發送到elasticsearch7.5時並沒有將數據發送到我們指定的index中,而是自動創建了名爲filebeat-{version}-{yyyy-MM-dd}的index,並將數據發送到該index中。
解決方案:
在yml文件中添加如下配置:
setup.ilm.enabled: false
官方文檔中指出:https://www.elastic.co/guide/en/beats/filebeat/7.5/ilm.html
setup.ilm.enabled
Enables or disables index lifecycle management on any new indices created by Filebeat. Valid values are true
, false
, and auto
. When auto
(the default) is specified on version 7.0 and later, Filebeat automatically uses index lifecycle management if the feature is enabled in Elasticsearch and has the required license; otherwise, Filebeat creates daily indices.
所以,當我們該屬性爲false時,就不再遵循ilm的管理,而是索引到我們自己指定的index中。