Class: Fluent::Plugin::ConditionalFilter

Inherits:
Filter
  • Object
show all
Includes:
ConditionalFilterRule
Defined in:
lib/fluent/plugin/filter_conditional.rb

Instance Method Summary collapse

Methods included from ConditionalFilterRule

#filter_record

Instance Method Details

#configure(conf) ⇒ Object



13
14
15
16
17
# File 'lib/fluent/plugin/filter_conditional.rb', line 13

def configure(conf)
  super

  @key_pattern_regexp = Regexp.new(key_pattern)
end

#filter(tag, time, record) ⇒ Object



19
20
21
22
23
# File 'lib/fluent/plugin/filter_conditional.rb', line 19

def filter(tag, time, record)
  record = filter_record(tag, time, record, self)

  record if record.any?
end