filebeat6配置index需要添加setup對應項,不然啟動會報錯。
6.0以后版本具體設置在filebeat.yml如下:
setup.template.name: "myname-01" #頂格,和output對其 setup.template.pattern: "myname-01-*" #頂格,和output對其 output.elasticsearch: hosts: ["192.168.10.63:9200"] index: "myname-01-%{+yyyy.MM.dd}" #和hosts對其
ES6 不再支持自己在同一個index下定義多個type. 因此 以前 filebeat中的 document_type 配置不再生效。
同時,由於 filebeat的 output.elasticsearch中的index配置並不能具體到 prospector 之中,所以一份配置文件只能共用一個index.
如果我有兩個日志文件 info.log err.log
我需要寫入到同一個es集群中的 log_info 、log_err 兩個 index中,該如何配置?
文檔給出了一個基於日志內容字段匹配的方案:
output.elasticsearch: hosts: ["http://localhost:9200"] index: "logs-%{[beat.version]}-%{+yyyy.MM.dd}" indices: - index: "critical-%{[beat.version]}-%{+yyyy.MM.dd}" when.contains: message: "CRITICAL" - index: "error-%{[beat.version]}-%{+yyyy.MM.dd}" when.contains: message: "ERR"
但是有一個問題是,如果這兩個日志文件無法通過特定的字段來區分,該如何實現將兩個文件的內容分別插入到不同的index中?
有一個臨時方案是,分別啟動兩個 fiilebeat 實例,通過 --path.config 指定不同的配置文件,兩個配置文件中配置不同的 index。
在 filebeat 支持 每個prospector 可以配置獨立的 index之前,有沒有其他比較好的方案?
備注:
kibana 漢化包地址:
https://github.com/anbai-inc/Kibana_Hanization
X-packed 相關地址:
https://blog.csdn.net/qq_25475209/article/details/81906701
一個很好的ELK XPACKED使用地址:
https://www.plaza4me.com/article/20180825222918266
直接導入license方法的地址:
https://blog.csdn.net/sun_duoLong/article/details/82182596
