Sha256: 605ad3664a40d235deb768544227c3f74feccd66d5efd8db3e8323a0fa64bfa5

Contents?: true

Size: 675 Bytes

Versions: 7

Compression:

Stored size: 675 Bytes

Contents

require 'fluent/formatter'

module Fluent
  module TextFormatter
    class GELFFormatter < Formatter

      Plugin.register_formatter("gelf", self)

      require 'fluent/gelf_util'
      include GelfUtil

      config_param :use_record_host, :bool, :default => true
      config_param :add_msec_time, :bool, :default => false

      def configure(conf)
        super(conf)
      end

      def format(tag, time, record)
        gelfentry = make_gelfentry(
          tag,time,record,
          {
            :use_record_host => @use_record_host,
            :add_msec_time => @add_msec_time
          }
        )

        make_json(gelfentry,{})
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
fluent-plugin-gelf-cg-1.0.6 lib/fluent/plugin/formatter_gelf.rb
fluent-plugin-gelf-cg-1.0.5 lib/fluent/plugin/formatter_gelf.rb
fluent-plugin-gelf-cg-1.0.4 lib/fluent/plugin/formatter_gelf.rb
fluent-plugin-gelf-hs-1.0.4 lib/fluent/plugin/formatter_gelf.rb
fluent-plugin-gelf-hs-1.0.3 lib/fluent/plugin/formatter_gelf.rb
fluent-plugin-gelf-hs-1.0.2 lib/fluent/plugin/formatter_gelf.rb
fluent-plugin-gelf-hs-1.0.1 lib/fluent/plugin/formatter_gelf.rb