class LogStash::Codecs::S3Plain

The “s3_plain” codec is used for backward compatibility with previous version of the S3 Output

Constants

MESSAGE_FIELD
SOURCE_FIELD
TAGS_FIELD

Public Instance Methods

decode(data) click to toggle source
# File lib/logstash/codecs/s3_plain.rb, line 14
def decode(data)
  raise RuntimeError.new("This codec is only used for backward compatibility with the previous S3 output.")
end
encode(event) click to toggle source
# File lib/logstash/codecs/s3_plain.rb, line 18
def encode(event)
  message = "Date: #{event.get(LogStash::Event::TIMESTAMP)}\n"
  message << "Source: #{event.get(SOURCE_FIELD)}\n"
  message << "Tags: #{Array(event.get(TAGS_FIELD)).join(', ')}\n"
  message << "Fields: #{event.to_hash.inspect}\n"
  message << "Message: #{event.get(MESSAGE_FIELD)}"

  @on_event.call(message)
end