filebeat直接给es传输日志,自定义索引名


ElasticStack从2019年1月29日的6.6.0版本的开始,引入了索引生命周期管理的功能,新版本的Filebeat则默认的配置开启了ILM,导致索引的命名规则被ILM策略控制。
加上这个配置就好了:

filebeat 配置关闭 ILM 即可解决Index Pattern不生效的问题
setup.ilm.enabled: false

具体配置:

#==================== Elasticsearch template setting ==========================
setup.ilm.enabled: false
setup.template.name: "filebeat-127"
setup.template.pattern: "filebeat-127-*"

setup.template.settings:
  index.number_of_shards: 1
  index.number_of_replicas: 0
  index.codec: best_compression 
#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
  hosts: ["127.0.0.1:9200"]
  index: "filebeat-127-%{+yyyy.MM.dd}"

  username: "elastic"
  password: "xxxxxxxxxxx"


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM