Class: LogStash::Codecs::JsonSpooler

Inherits:
Spool show all
Defined in:
lib/logstash/codecs/json_spooler.rb

Overview

This is the base class for logstash codecs.

Constant Summary

Constants included from LogStash::Config::Mixin

LogStash::Config::Mixin::CONFIGSORT

Instance Attribute Summary

Attributes inherited from Spool

#buffer

Attributes included from LogStash::Config::Mixin

#config, #original_params

Attributes inherited from Plugin

#logger, #params

Instance Method Summary collapse

Methods inherited from Spool

#teardown

Methods inherited from Base

#clone, #flush, #initialize, #on_event, #teardown

Methods included from LogStash::Config::Mixin

#config_init, included

Methods inherited from Plugin

#eql?, #finished, #finished?, #hash, #initialize, #inspect, lookup, #reload, #running?, #shutdown, #teardown, #terminating?, #to_s

Constructor Details

This class inherits a constructor from LogStash::Codecs::Base

Instance Method Details

#decode(data) ⇒ Object



11
12
13
14
15
# File 'lib/logstash/codecs/json_spooler.rb', line 11

def decode(data)
  super(JSON.parse(data.force_encoding("UTF-8"))) do |event|
    yield event
  end
end

#encode(data) ⇒ Object



18
19
20
# File 'lib/logstash/codecs/json_spooler.rb', line 18

def encode(data)
  super(data)
end