module Fluent::HandleTagNameMixin
Attributes
add_tag_prefix[RW]
add_tag_suffix[RW]
remove_tag_prefix[RW]
remove_tag_suffix[RW]
Public Instance Methods
configure(conf)
click to toggle source
Calls superclass method
# File lib/fluent/mixin.rb, line 100 def configure(conf) super if remove_tag_prefix = conf['remove_tag_prefix'] @remove_tag_prefix = Regexp.new('^' + Regexp.escape(remove_tag_prefix)) end if remove_tag_suffix = conf['remove_tag_suffix'] @remove_tag_suffix = Regexp.new(Regexp.escape(remove_tag_suffix) + '$') end @add_tag_prefix = conf['add_tag_prefix'] @add_tag_suffix = conf['add_tag_suffix'] end
filter_record(tag, time, record)
click to toggle source
Calls superclass method
Fluent::RecordFilterMixin#filter_record
# File lib/fluent/mixin.rb, line 114 def filter_record(tag, time, record) tag.sub!(@remove_tag_prefix, '') if @remove_tag_prefix tag.sub!(@remove_tag_suffix, '') if @remove_tag_suffix tag.insert(0, @add_tag_prefix) if @add_tag_prefix tag << @add_tag_suffix if @add_tag_suffix super(tag, time, record) end