I am new to logstash and I’m trying to setup a logstash instance to see if we can use it as a syslog\trap front end to some of our network nodes. I have it working at a very basic level but can’t seem to get the sleep filter working. I’m currently testing with traps and I’m trying to suppress traps using the sleep function. However, it just writes all of the traps to the output file. I assume I’m missing something in the filter section but I’m not sure what it is.
input {
snmptrap {
community => "public"
port => 162
type => "snmp_trap"
}
}
filter {
sleep {
time => "60" # Sleep 60 seconds
every => 3 # on every 3rd event
}
}
output {
if [type] == "snmp_trap" {
file {
codec => "rubydebug"
flush_interval => 1
path => "C:\LogstashOutput\SNMPTraps\logstash-snmptrap.log"
}
}
}