Class: LogStash::Filters::Drop

Inherits:
Base show all
Defined in:
lib/logstash/filters/drop.rb

Overview

Drop filter.

Drops everything that gets to this filter.

This is best used in combination with conditionals, for example:

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.

Constant Summary

Constants inherited from Base

Base::RESERVED

Constants included from Config::Mixin

Config::Mixin::CONFIGSORT

Instance Attribute Summary

Attributes included from Config::Mixin

#config, #original_params

Attributes inherited from Plugin

#logger, #params

Instance Method Summary collapse

Methods inherited from Base

#execute, #initialize, #threadsafe?

Methods included from Config::Mixin

#config_init, included

Methods inherited from Plugin

#eql?, #finished, #finished?, #hash, #initialize, #inspect, lookup, #reload, #running?, #shutdown, #teardown, #terminating?, #to_s

Constructor Details

This class inherits a constructor from LogStash::Filters::Base

Instance Method Details

#filter(event) ⇒ Object



29
30
31
# File 'lib/logstash/filters/drop.rb', line 29

def filter(event)
  event.cancel
end

#registerObject



24
25
26
# File 'lib/logstash/filters/drop.rb', line 24

def register
  # nothing to do.
end