filebeat修改索引名字


節點

filebeat版本6.0.0

編輯 filebeat.yml

添加修改如下:

#-------------------------- Elasticsearch output ------------------------------
setup.template.name: "btcfile"      //修改成自己的名字,名字必須小寫,大寫報錯
setup.template.pattern: "btcfile-*"      
output.elasticsearch:
# Array of hosts to connect to.
hosts: ["192.168.1.2:9200"]
index: "btcfile-%{+yyyy.MM.dd}"    //索引

 

手動加載模塊,先關閉logstash,然后指定已elastic輸出方式。

filebeat setup --template -E output.logstash.enabled=false -E 'output.elasticsearch.hosts=["192.168.1.2:9200"]'

重啟filebeat  systemctl restart filebeat

主節點測試:

~]$ curl '192.168.1.3:9200/_cat/indices?v'
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open btcfile-2019.01.30 oYsEaZXQAO2Q7yLPFx03brKjg 3 1 214 0 115.9kb 49.4kb
green open .kibana VTfHCbEuQACAgdUSO5GsO8FZQ 1 1 3 1 47.5kb 23.7kb
green open system-syslog-2019.01 zflaFValeMQ6KN8PrKvjbWVPw 5 1 25577 0 32.1mb 15.9mb

成功。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM