I want to split my filter block into separate files for better readability and easier maintenance and of course by doing that I cannot if-else through the various checks meaning that every input will go through all the filters.
In rsyslog there's a "stop" instruction that prevents this from happening but I cannot find a way to do the same thing in Logstash.
Something like this:
input {
udp {
port => 5514
}
}
filter {
if "thisToken" in [message] {
json {
source => "message"
add_tag => ["this"]
}
stop #<------------ how?
if "thatToken" in [message] {
json {
source => "message"
add_tag => ["that"]
}
stop #<------------ how?
}
output {
file {
path => "/var/log/logstash/output.log"
}
}