class LogStash::Filters::Drop
Drop
filter.
Drops everything that gets to this filter.
This is best used in combination with conditionals, for example:
- source,ruby
-
filter {
if [loglevel] == "debug" { drop { } }
}
The above will only pass events to the drop filter if the loglevel field is `debug`. This will cause all events matching to be dropped.
Public Instance Methods
filter(event)
click to toggle source
# File lib/logstash/filters/drop.rb, line 41 def filter(event) event.cancel if (@percentage == 100 || rand < (@percentage / 100.0)) end
register()
click to toggle source
# File lib/logstash/filters/drop.rb, line 36 def register # nothing to do. end