Class: Fluent::Plugin::RewriteFilter
- Inherits:
-
Filter
- Object
- Filter
- Fluent::Plugin::RewriteFilter
- Defined in:
- lib/fluent/plugin/filter_rewrite.rb
Instance Attribute Summary collapse
-
#rewrite_rule ⇒ Object
readonly
Returns the value of attribute rewrite_rule.
Instance Method Summary collapse
Instance Attribute Details
#rewrite_rule ⇒ Object (readonly)
Returns the value of attribute rewrite_rule.
5 6 7 |
# File 'lib/fluent/plugin/filter_rewrite.rb', line 5 def rewrite_rule @rewrite_rule end |
Instance Method Details
#configure(conf) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/fluent/plugin/filter_rewrite.rb', line 7 def configure(conf) require 'fluent/plugin/rewrite_rule' super @rewrite_rule = Fluent::RewriteRule.new(self, conf) end |
#filter_stream(tag, es) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/fluent/plugin/filter_rewrite.rb', line 15 def filter_stream(tag, es) new_es = Fluent::MultiEventStream.new es.each do |time, record| record = @rewrite_rule.rewrite(record) new_es.add(time, record) if record end new_es end |