Class: LogStash::Filters::Grok::Matcher
- Inherits:
-
Object
- Object
- LogStash::Filters::Grok::Matcher
- Defined in:
- lib/logstash/filters/grok.rb
Overview
Internal (base) helper to handle the global timeout switch.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(filter) ⇒ Matcher
constructor
A new instance of Matcher.
- #match(context, groks, event, break_on_match) ⇒ Object
Constructor Details
#initialize(filter) ⇒ Matcher
Returns a new instance of Matcher.
374 375 376 |
# File 'lib/logstash/filters/grok.rb', line 374 def initialize(filter) @filter = filter end |
Instance Method Details
#match(context, groks, event, break_on_match) ⇒ Object
378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 |
# 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 |