Class: LogStash::Filters::Jdbc::Lookup::Sprintfier
- Inherits:
-
Object
- Object
- LogStash::Filters::Jdbc::Lookup::Sprintfier
- Defined in:
- lib/logstash/filters/jdbc/lookup.rb
Instance Method Summary collapse
- #fetch(event, result) ⇒ Object
-
#initialize(param) ⇒ Sprintfier
constructor
A new instance of Sprintfier.
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 |