Class: LogStash::Filters::Field

Inherits:
Base
  • Object
show all
Defined in:
lib/logstash/filters/field.rb

Defined Under Namespace

Classes: EvalSpace

Instance Attribute Summary

Attributes inherited from Base

#logger

Instance Method Summary collapse

Methods inherited from Base

#add_config, #initialize

Constructor Details

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

Instance Method Details

#filter(event) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/logstash/filters/field.rb', line 18

def filter(event)
  data = EvalSpace.new(event.to_hash)

  @config.each do |condition|
    if data.instance_eval(condition)
      return # This event is OK, matches the condition.
    end
  end
  event.cancel
end

#registerObject



13
14
15
# File 'lib/logstash/filters/field.rb', line 13

def register
  # nothing to do
end