Class: Fluent::Plugin::GrepFilter::Expression

Inherits:
Struct
  • Object
show all
Defined in:
lib/fluent/plugin/filter_grep.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



183
184
185
# File 'lib/fluent/plugin/filter_grep.rb', line 183

def key
  @key
end

#patternObject

Returns the value of attribute pattern

Returns:

  • (Object)

    the current value of pattern



183
184
185
# File 'lib/fluent/plugin/filter_grep.rb', line 183

def pattern
  @pattern
end

Instance Method Details

#match?(record) ⇒ Boolean

Returns:

  • (Boolean)


184
185
186
# File 'lib/fluent/plugin/filter_grep.rb', line 184

def match?(record)
  ::Fluent::StringUtil.match_regexp(pattern, key.call(record).to_s)
end