I am logging to more than one ports using syslog plugin.
However the following conditional filter does not work (although logs are received in more than one port as expected.
Any suggestions?
input {
tcp {
port => 5151
type => syslog
}
tcp {
port => 5152
type => syslog
}
}
filter {
if [port] == 5151 {
mutate {
add_field => {'received_from' => 'service1'}
}
}
if [port] == 5152 {
mutate {
add_field => {'received_from' => 'service2'}
}
}
}
output {
elasticsearch { hosts => ["localhost:9200"] }
stdout { codec => rubydebug }
}