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
Instance Method Summary collapse
Instance Method Details
#decode(data) ⇒ Object
11 12 13 |
# File 'lib/logstash/codecs/s3_plain.rb', line 11 def decode(data) raise RuntimeError.new("This codec is only used for backward compatibility with the previous S3 output.") end |
#encode(event) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/logstash/codecs/s3_plain.rb', line 16 def encode(event) if event.is_a?(LogStash::Event) = "Date: #{event[LogStash::Event::TIMESTAMP]}\n" << "Source: #{event["source"]}\n" << "Tags: #{Array(event["tags"]).join(', ')}\n" << "Fields: #{event.to_hash.inspect}\n" << "Message: #{event["message"]}" @on_event.call() else @on_event.call(event.to_s) end end |