Class: LogStash::Filters::Clone
- Defined in:
- lib/logstash/filters/clone.rb
Overview
The clone filter is for duplicating events. A clone will be made for each type in the clone list. The original event is left unchanged.
Constant Summary
Constants inherited from Base
Constants included from Config::Mixin
Instance Attribute Summary
Attributes included from Config::Mixin
Attributes inherited from Plugin
Instance Method Summary collapse
Methods inherited from Base
#execute, #initialize, #threadsafe?
Methods included from Config::Mixin
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::Filters::Base
Instance Method Details
#filter(event) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/logstash/filters/clone.rb', line 22 def filter(event) return unless filter?(event) @clones.each do |type| clone = event.clone clone["type"] = type filter_matched(clone) @logger.debug("Cloned event", :clone => clone, :event => event) # Push this new event onto the stack at the LogStash::FilterWorker yield clone end end |
#register ⇒ Object
17 18 19 |
# File 'lib/logstash/filters/clone.rb', line 17 def register # Nothing to do end |