Sha256: 63e55d20c0f82bfda42bd7014e2326348511566deb23fd2996ed9ada59277050

Contents?: true

Size: 556 Bytes

Versions: 7

Compression:

Stored size: 556 Bytes

Contents

# {
#   "tag": {
#     "with": [ "" ]
#   }
# }
module Anschel
  class Filter
    def tag conf, stats, log
      tags = conf.delete :with

      raise 'Missing required "with" for "tag" filter' if tags.nil?

      tags = tags.is_a?(Array) ? tags : [ tags ]

      stats.create 'filter-tag'

      log.info event: 'filter-compiled', kind: 'tag', with: tags



      lambda do |event|
        event[:tags] ||= []
        event[:tags]  += tags
        event[:tags].uniq!
        stats.inc 'filter-tag'
        filtered event, conf
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
anschel-0.7.19 lib/anschel/filter/tag.rb
anschel-0.7.18 lib/anschel/filter/tag.rb
anschel-0.7.17 lib/anschel/filter/tag.rb
anschel-0.7.16 lib/anschel/filter/tag.rb
anschel-0.7.15 lib/anschel/filter/tag.rb
anschel-0.7.14 lib/anschel/filter/tag.rb
anschel-0.7.13 lib/anschel/filter/tag.rb