Class: Fluent::Plugin::ProcInfo::Eventer
- Inherits:
-
Object
- Object
- Fluent::Plugin::ProcInfo::Eventer
- Defined in:
- lib/fluent/plugin/proc_info/eventer.rb
Instance Attribute Summary collapse
-
#event_prefix ⇒ Object
readonly
Returns the value of attribute event_prefix.
-
#metadata_prefix ⇒ Object
readonly
Returns the value of attribute metadata_prefix.
-
#timestamp_format ⇒ Object
readonly
Returns the value of attribute timestamp_format.
-
#timestamp_key ⇒ Object
readonly
Returns the value of attribute timestamp_key.
Instance Method Summary collapse
- #generate_event(name:, value:, metadata: {}) ⇒ Object
-
#initialize(timestamp_key:, timestamp_format:, event_prefix:, metadata_prefix:) ⇒ Eventer
constructor
A new instance of Eventer.
Constructor Details
#initialize(timestamp_key:, timestamp_format:, event_prefix:, metadata_prefix:) ⇒ Eventer
Returns a new instance of Eventer.
11 12 13 14 15 16 17 18 19 |
# File 'lib/fluent/plugin/proc_info/eventer.rb', line 11 def initialize(timestamp_key:, timestamp_format:, event_prefix:, metadata_prefix:) = = @event_prefix = event_prefix = end |
Instance Attribute Details
#event_prefix ⇒ Object (readonly)
Returns the value of attribute event_prefix.
9 10 11 |
# File 'lib/fluent/plugin/proc_info/eventer.rb', line 9 def event_prefix @event_prefix end |
#metadata_prefix ⇒ Object (readonly)
Returns the value of attribute metadata_prefix.
9 10 11 |
# File 'lib/fluent/plugin/proc_info/eventer.rb', line 9 def end |
#timestamp_format ⇒ Object (readonly)
Returns the value of attribute timestamp_format.
9 10 11 |
# File 'lib/fluent/plugin/proc_info/eventer.rb', line 9 def end |
#timestamp_key ⇒ Object (readonly)
Returns the value of attribute timestamp_key.
9 10 11 |
# File 'lib/fluent/plugin/proc_info/eventer.rb', line 9 def end |
Instance Method Details
#generate_event(name:, value:, metadata: {}) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/fluent/plugin/proc_info/eventer.rb', line 21 def generate_event(name:, value:, metadata: {}) base.update({ "#{event_prefix}name" => name, "#{event_prefix}value" => value }) .update(.transform_keys { |k| "#{metadata_prefix}#{k}" }) end |