各位好
想請教一件小事
filebeat的output logstash
如果我要123.log和456.log
分別輸出到logstash的5045port跟5046port
(要123.log對應5045)(456.log對應5046)
這樣可以做到嗎
要在哪裡加上甚麼嗎
logstash設定已經設好了
剩filebeat
on the FILEBEAT side setup filebeat.yml to have references on my all log files (using filebeat.config.inputs attribute) and tags related wit every input file
on the LOGSTASH side setup one configuration file, now listening on on unique port and then
inside one big configuration file use "if, elseif" based on the tags, so every time we have the execution of adequate part of pipline configuration (based on its tag)
不能,beats 的 output 只能做 load balance,請在 input 開多個 type 為 log 的陣列並在同個欄位設定不同的植仰賴 logstash 做 if/else 處理,以下為範例 filebeat 設定檔的範例
filebeat.inputs:
- type: log
paths:
- /var/log/a.log
fields:
which_from: a.log
fields_under_root: true
- type: log
paths:
- /var/log/b.log
fields:
which_from: b.log
fields_under_root: true