Sha256: f85a6f7bda7c5f615196aee478452f03e6d8d17de10714f3b38dd5320eda869f

Contents?: true

Size: 618 Bytes

Versions: 1

Compression:

Stored size: 618 Bytes

Contents

require 'fluent/parser'

module Fluent
  module Mixin
    module TypeConverter
      include Configurable
      include RecordFilterMixin
      include Fluent::TextParser::TypeConverter

      attr_accessor :types, :types_delimiter, :types_label_delimiter

      def configure(conf)
        super

      end

      def filter_record(tag, time, record)
        super
        if @types
          convert_field_type!(record)
        end
      end

      def convert_field_type!(record)
        record.each { |key, value|
          record[key] = convert_type(key, value)
        }
        self
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fluent-mixin-type-converter-0.1.0 lib/fluent/mixin/type_converter.rb