Class: LogStash::Codecs::Base

Inherits:
Plugin
  • Object
show all
Includes:
LogStash::Config::Mixin
Defined in:
lib/logstash/codecs/base.rb

Constant Summary

Constants included from LogStash::Config::Mixin

LogStash::Config::Mixin::CONFIGSORT

Instance Attribute Summary

Attributes included from LogStash::Config::Mixin

#config, #original_params

Attributes inherited from Plugin

#logger, #params

Instance Method Summary collapse

Methods included from LogStash::Config::Mixin

#config_init, included

Methods inherited from Plugin

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

Constructor Details

#initialize(params = {}) ⇒ Base

Returns a new instance of Base.



12
13
14
15
16
# File 'lib/logstash/codecs/base.rb', line 12

def initialize(params={})
  super
  config_init(params)
  register if respond_to?(:register)
end

Instance Method Details

#cloneObject



46
47
48
# File 'lib/logstash/codecs/base.rb', line 46

def clone
  return self.class.new(params)
end

#decode(data) ⇒ Object Also known as: <<



19
20
21
# File 'lib/logstash/codecs/base.rb', line 19

def decode(data)
  raise "#{self.class}#decode must be overidden"
end

#encode(data) ⇒ Object



26
27
28
# File 'lib/logstash/codecs/base.rb', line 26

def encode(data)
  raise "#{self.class}#encode must be overidden"
end

#flush(&block) ⇒ Object



39
40
41
42
43
# File 'lib/logstash/codecs/base.rb', line 39

def flush(&block)
  # does nothing by default.
  # if your codec needs a flush method (like you are spooling things)
  # you must implement this.
end

#on_event(&block) ⇒ Object



34
35
36
# File 'lib/logstash/codecs/base.rb', line 34

def on_event(&block)
  @on_event = block
end

#teardownObject



31
# File 'lib/logstash/codecs/base.rb', line 31

def teardown; end