Class: Fluent::Plugin::AMQPOutput::HeaderElement
- Inherits:
-
Object
- Object
- Fluent::Plugin::AMQPOutput::HeaderElement
- Includes:
- Configurable
- Defined in:
- lib/fluent/plugin/out_amqp.rb
Instance Method Summary collapse
- #getNestedValue(data, path) ⇒ Object
-
#getValue(data) ⇒ Object
Extract a header and value from the input data returning nil if value cannot be derived.
Instance Method Details
#getNestedValue(data, path) ⇒ Object
80 81 82 83 84 85 86 87 |
# File 'lib/fluent/plugin/out_amqp.rb', line 80 def getNestedValue(data, path) temp_data = data temp_path = path.dup until temp_data.nil? or temp_path.empty? temp_data = temp_data[temp_path.shift] end temp_data end |
#getValue(data) ⇒ Object
Extract a header and value from the input data returning nil if value cannot be derived
74 75 76 77 78 |
# File 'lib/fluent/plugin/out_amqp.rb', line 74 def getValue(data) val = getNestedValue(data, @source ) if @source val ||= @default if @default val end |