Class: LogStash::Filters::Combine
- Inherits:
-
Base
- Object
- Base
- LogStash::Filters::Combine
- Defined in:
- lib/logstash/filters/combine.rb
Overview
This combine filter will replace the contents of the default message field with whatever you specify in the configuration.
It is only intended to be used as an combine.
Instance Method Summary collapse
Instance Method Details
#filter(event) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/logstash/filters/combine.rb', line 33 def filter(event) arr = [] @sources.each do |field| data = event.get(field) if !data.nil? arr << data event.remove(field) if @remove_sources end end if arr.length() > 0 event.set(@target, arr) filter_matched(event) end end |
#register ⇒ Object
28 29 30 |
# File 'lib/logstash/filters/combine.rb', line 28 def register # Add instance variables end |