Class: LogStash::Filters::Jdbc::Lookup::Sprintfier

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/filters/jdbc/lookup.rb

Instance Method Summary collapse

Constructor Details

#initialize(param) ⇒ Sprintfier

Returns a new instance of Sprintfier.



12
13
14
# File 'lib/logstash/filters/jdbc/lookup.rb', line 12

def initialize(param)
  @param = param
end

Instance Method Details

#fetch(event, result) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/logstash/filters/jdbc/lookup.rb', line 16

def fetch(event, result)
  formatted = event.sprintf(@param)
  if formatted == @param # no field found so no transformation
    result.invalid_parameters_push(@param)
  end
  formatted
end