Sha256: 72bd8e17760f7c1bdd12e444016a7e6b712e66eb39baf4e1ac3ff1144fbcae43

Contents?: true

Size: 575 Bytes

Versions: 4

Compression:

Stored size: 575 Bytes

Contents

require 'fluent/plugin/out_mongo'

module Fluent


class MongoOutputTagCollection < MongoOutput
  Fluent::Plugin.register_output('mongo_tag_collection', self)

  config_param :collection, :string, :default => 'untagged'

  def configure(conf)
    super

    if remove_prefix_collection = conf['remove_prefix_collection']
      @remove_prefix_collection = Regexp.new('^' + Regexp.escape(remove_prefix_collection))
    end
  end

  def emit(tag, es, chain)
    super(tag, es, chain, tag)
  end

  def write(chunk)
    operate(chunk.key, collect_records(chunk))
  end
end


end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fluent-plugin-mongo-0.5.3 lib/fluent/plugin/out_mongo_tag_collection.rb
fluent-plugin-mongo-0.5.2 lib/fluent/plugin/out_mongo_tag_collection.rb
fluent-plugin-mongo-0.5.1 lib/fluent/plugin/out_mongo_tag_collection.rb
fluent-plugin-mongo-0.5.0 lib/fluent/plugin/out_mongo_tag_collection.rb