Class: LogStash::Filters::Base

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

Constant Summary collapse

RESERVED =
["type", "tags", "exclude_tags", "include_fields", "exclude_fields", "add_tag", "remove_tag", "add_field", "remove_field", "include_any", "exclude_any"]

Constants included from Config::Mixin

Config::Mixin::CONFIGSORT

Instance Attribute Summary

Attributes included from Config::Mixin

#config, #original_params

Attributes inherited from Plugin

#logger, #params

Instance Method Summary collapse

Methods included from Config::Mixin

#config_init, included

Methods inherited from Plugin

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

Constructor Details

#initialize(params) ⇒ Base

Returns a new instance of Base.



91
92
93
94
95
# File 'lib/logstash/filters/base.rb', line 91

def initialize(params)
  super
  config_init(params)
  @threadsafe = true
end

Instance Method Details

#execute(event, &block) ⇒ Object



108
109
110
# File 'lib/logstash/filters/base.rb', line 108

def execute(event, &block)
  filter(event, &block)
end

#filter(event) ⇒ Object



103
104
105
# File 'lib/logstash/filters/base.rb', line 103

def filter(event)
  raise "#{self.class}#filter must be overidden"
end

#registerObject



98
99
100
# File 'lib/logstash/filters/base.rb', line 98

def register
  raise "#{self.class}#register must be overidden"
end

#threadsafe?Boolean

Returns:

  • (Boolean)


113
114
115
# File 'lib/logstash/filters/base.rb', line 113

def threadsafe?
  @threadsafe
end