Sha256: 56045a1ec3b77fa5a969a40eaee2b74c92bae9f5659ce06accba95533f5a8858
Contents?: true
Size: 584 Bytes
Versions: 18
Compression:
Stored size: 584 Bytes
Contents
# frozen_string_literal: true require 'fluent/match' class Fluent::Plugin::SplunkOutput::MatchFormatter def initialize(pattern, formatter) # based on fluentd/lib/fluent/event_router.rb patterns = pattern.split(/\s+/).map do |str| Fluent::MatchPattern.create(str) end @pattern = if patterns.length == 1 patterns[0] else Fluent::OrMatchPattern.new(patterns) end @formatter = formatter end def match?(tag) @pattern.match tag end def format(tag, time, record) @formatter.format tag, time, record end end
Version data entries
18 entries across 18 versions & 1 rubygems