Class: Fluent::Plugin::Base64Parser
- Inherits:
-
Parser
- Object
- Parser
- Fluent::Plugin::Base64Parser
- Defined in:
- lib/fluent/plugin/parser_base64.rb
Instance Method Summary collapse
-
#initialize ⇒ Base64Parser
constructor
A new instance of Base64Parser.
- #parse(text) {|time, record| ... } ⇒ Object
Constructor Details
#initialize ⇒ Base64Parser
Returns a new instance of Base64Parser.
11 12 13 14 |
# File 'lib/fluent/plugin/parser_base64.rb', line 11 def initialize super require 'base64' end |
Instance Method Details
#parse(text) {|time, record| ... } ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/fluent/plugin/parser_base64.rb', line 16 def parse(text) record = {} if (@base64_encode) record[@message_key] = ::Base64.strict_encode64(text) else record[@message_key] = ::Base64.strict_decode64(text) end time = @estimate_current_event ? Fluent::Engine.now : nil yield time, record end |