Included Modules

Class/Module Index [+]

Quicksearch

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
# File lib/fluent/mixin.rb, line 108
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
# File lib/fluent/mixin.rb, line 122
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

[Validate]

Generated with the Darkfish Rdoc Generator 2.