Hi, I have one config file in filebeat, i am trying to add two paths for reading the logs from two different locations and under feilds i have created two directories for storing the values in logstash side.
Below is the config files.:
filebeat.inputs:
- type: log
enabled: true
paths:
- "C:\\devops\\poms\\logs\\ *.log"
- * "C:\\test\\logs1\\ *.log"
fields_under_root: true
fields:
dir1: application1
dir2: application2</em>
output.logstash:
enabled: true
hosts: ["localhost:5060"]
And logstash output is:
output {
stdout { codec => rubydebug }
file {
codec => line { format => "%{message}"}
#path => ["C:\Temp\junk\logs\testdoc.log-%{+YYYY.MM.dd}"]
#path => ["C:\Temp\junk\logs%{[dir]}%{[fileName]}-%{+YYYY.MM.dd}" && "C:\Temp\junk\logs1%{[dir]}%{[fileName]}-%{+YYYY.MM.dd}"]
path => "C:\Temp\junk\logs%{[dir1]}%{[fileName]}-%{+YYYY.MM.dd}"
}
file {
codec => line { format => "{message}" }
path => "C:\Temp\junk\logs1%{[dir2]}%{[fileName]}-%{+YYYY.MM.dd}"
}
..
When i execute this, in both directories only this path files 'C:\test\logs1\ *.log" 'are reading from filebeat side and writing output from logstash.
Would like to know best solution for this.
Thanks in Advance.