Sha256: 92c47511832ceb9b2b299ea598489ae23e4c67bcdf8ec6b6897f17a8a30f4008

Contents?: true

Size: 800 Bytes

Versions: 2

Compression:

Stored size: 800 Bytes

Contents

# frozen_string_literal: true

require 'fluent/plugin/filter'
require 'fluent/plugin/systemd/entry_mutator'

module Fluent
  module Plugin
    # Fluentd systemd/journal filter plugin
    class SystemdEntryFilter < Filter
      Fluent::Plugin.register_filter('systemd_entry', self)

      config_param :field_map, :hash, default: {}
      config_param :field_map_strict, :bool, default: false
      config_param :fields_strip_underscores, :bool, default: false
      config_param :fields_lowercase, :bool, default: false

      def configure(conf)
        super
        @mutator = SystemdEntryMutator.new(**@config_root_section.to_h)
        @mutator.warnings.each { |warning| log.warn(warning) }
      end

      def filter(_tag, _time, entry)
        @mutator.run(entry)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fluent-plugin-systemd-1.0.0.rc2 lib/fluent/plugin/filter_systemd_entry.rb
fluent-plugin-systemd-1.0.0.rc1 lib/fluent/plugin/filter_systemd_entry.rb