Class: Edge::Entry
- Inherits:
-
Object
- Object
- Edge::Entry
- Includes:
- Edge
- Defined in:
- lib/logstash/outputs/Edge/entry.rb
Instance Attribute Summary collapse
-
#entry ⇒ Object
readonly
Returns the value of attribute entry.
-
#labels ⇒ Object
readonly
Returns the value of attribute labels.
Instance Method Summary collapse
-
#initialize(event, message_field, include_fields) ⇒ Entry
constructor
A new instance of Entry.
Methods included from Edge
Constructor Details
#initialize(event, message_field, include_fields) ⇒ Entry
Returns a new instance of Entry.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/logstash/outputs/Edge/entry.rb', line 8 def initialize(event,,include_fields) @entry = { "ts" => to_ns(event.get("@timestamp")), "line" => event.get().to_s } event = event.clone() event.remove() event.remove("@timestamp") @labels = {} event.to_hash.each { |key,value| next if key.start_with?('@') next if value.is_a?(Hash) next if include_fields.length() > 0 and not include_fields.include?(key) @labels[key] = value.to_s } end |
Instance Attribute Details
#entry ⇒ Object (readonly)
Returns the value of attribute entry.
7 8 9 |
# File 'lib/logstash/outputs/Edge/entry.rb', line 7 def entry @entry end |
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
7 8 9 |
# File 'lib/logstash/outputs/Edge/entry.rb', line 7 def labels @labels end |