Class: LogStash::Codecs::S3Plain
- Inherits:
-
Base
- Object
- Base
- LogStash::Codecs::S3Plain
- Defined in:
- lib/logstash/codecs/s3_plain.rb
Overview
The “s3_plain” codec is used for backward compatibility with previous version of the S3 Output
Constant Summary collapse
- SOURCE_FIELD =
"source".freeze
- TAGS_FIELD =
"tags".freeze
- MESSAGE_FIELD =
"message".freeze
Instance Method Summary collapse
Instance Method Details
#decode(data) ⇒ Object
14 15 16 |
# 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) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/logstash/codecs/s3_plain.rb', line 18 def encode(event) = "Date: #{event.get(LogStash::Event::TIMESTAMP)}\n" << "Source: #{event.get(SOURCE_FIELD)}\n" << "Tags: #{Array(event.get(TAGS_FIELD)).join(', ')}\n" << "Fields: #{event.to_hash.inspect}\n" << "Message: #{event.get(MESSAGE_FIELD)}" @on_event.call() end |