Hi Team,
I am using file to inject two types of logs available on the same server via tcp port communication, since the log source is different i want two different indices to be created from logstash, which i am not able to achieve. I am copying my output section for your reference. need help on this.
Logstash output:
output {
if [log_source] in [ "califfornia" , "newyork", "losangeles" ] {
elasticsearch {
hosts => [ "XXXXXXXXx:9200" ]
user => "yyyyyyyyyy"
password => "ppppppp"
index => "usregion-log-%{log_source}-%{+YYYY.MM.dd}"
}
else if [log_source] in [ "england" , "india", "pakistan" ] {
elasticsearch {
hosts => [ "XXXXXXXXx:9200" ]
user => "yyyyyyyyyy"
password => "ppppppp"
index => "intlregion-log-%{log_source}-%{+YYYY.MM.dd}"
}
}
stdout { codec => rubydebug }
}