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