Class: LogStash::Inputs::Beats::DecodedEventTransform

Inherits:
EventTransformCommon show all
Defined in:
lib/logstash/inputs/beats/decoded_event_transform.rb

Overview

Take the extracted content from the codec, merged with the other data coming from beats, apply the configured tags, normalize the host and try to coerce the timestamp if it was provided in the hash.

Instance Method Summary collapse

Methods inherited from EventTransformCommon

#codec_name, #copy_beat_hostname, #decorate, #include_codec_tag?, #initialize

Constructor Details

This class inherits a constructor from LogStash::Inputs::Beats::EventTransformCommon

Instance Method Details

#transform(event, hash) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/logstash/inputs/beats/decoded_event_transform.rb', line 8

def transform(event, hash)
  ts = coerce_ts(hash.delete("@timestamp"))

  event.set("@timestamp", ts) unless ts.nil?
  hash.each { |k, v| event.set(k, v) }
  super(event)
  event.tag("beats_input_codec_#{codec_name}_applied") if include_codec_tag?
  event
end