Class: LogStash::Filters::Base
Constant Summary
collapse
- RESERVED =
["type", "tags", "exclude_tags", "include_fields", "exclude_fields", "add_tag", "remove_tag", "add_field", "remove_field", "include_any", "exclude_any"]
Config::Mixin::CONFIGSORT, Config::Mixin::PLUGIN_VERSION_0_9_0, Config::Mixin::PLUGIN_VERSION_1_0_0
Constants inherited
from Plugin
Plugin::NL
Instance Attribute Summary
#config, #original_params
Attributes inherited from Plugin
#logger, #params
Instance Method Summary
collapse
#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.
134
135
136
137
138
|
# File 'lib/logstash/filters/base.rb', line 134
def initialize(params)
super
config_init(params)
@threadsafe = true
end
|
Instance Method Details
#execute(event, &block) ⇒ Object
170
171
172
|
# File 'lib/logstash/filters/base.rb', line 170
def execute(event, &block)
filter(event, &block)
end
|
#filter(event) ⇒ Object
146
147
148
|
# File 'lib/logstash/filters/base.rb', line 146
def filter(event)
raise "#{self.class}#filter must be overidden"
end
|
#multi_filter(events) ⇒ Object
158
159
160
161
162
163
164
165
166
167
|
# File 'lib/logstash/filters/base.rb', line 158
def multi_filter(events)
result = []
events.each do |event|
unless event.cancelled?
result << event
filter(event){|new_event| result << new_event}
end
end
result
end
|
#register ⇒ Object
141
142
143
|
# File 'lib/logstash/filters/base.rb', line 141
def register
raise "#{self.class}#register must be overidden"
end
|
#teardown ⇒ Object
238
239
240
|
# File 'lib/logstash/filters/base.rb', line 238
def teardown
end
|
#threadsafe? ⇒ Boolean
175
176
177
|
# File 'lib/logstash/filters/base.rb', line 175
def threadsafe?
@threadsafe
end
|