class LogStash::Filters::Grok::Matcher

Internal (base) helper to handle the global timeout switch. @private

Public Class Methods

new(filter) click to toggle source
# File lib/logstash/filters/grok.rb, line 374
def initialize(filter)
  @filter = filter
end

Public Instance Methods

match(context, groks, event, break_on_match) click to toggle source
# File lib/logstash/filters/grok.rb, line 378
def match(context, groks, event, break_on_match)
  matched = false

  groks.each do |grok|
    context.set_grok(grok)

    matched = execute(context, grok)
    if matched
      grok.capture(matched) { |field, value| @filter.handle(field, value, event) }
      break if break_on_match
    end
  end

  matched
end

Protected Instance Methods

execute(context, grok) click to toggle source
# File lib/logstash/filters/grok.rb, line 396
def execute(context, grok)
  grok.execute(context.input)
end