Class: Loki::Entry
- Inherits:
-
Object
- Object
- Loki::Entry
- Includes:
- Loki
- Defined in:
- lib/logstash/outputs/loki/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) ⇒ Entry
constructor
A new instance of Entry.
Methods included from Loki
Constructor Details
#initialize(event, message_field) ⇒ Entry
Returns a new instance of Entry.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/logstash/outputs/loki/entry.rb', line 8 def initialize(event,) @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) @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/loki/entry.rb', line 7 def entry @entry end |
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
7 8 9 |
# File 'lib/logstash/outputs/loki/entry.rb', line 7 def labels @labels end |