Module: Fluent::Mixin::TypeConverter

Includes:
Configurable, TextParser::TypeConverter, RecordFilterMixin
Defined in:
lib/fluent/mixin/type_converter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#typesObject

Returns the value of attribute types.



10
11
12
# File 'lib/fluent/mixin/type_converter.rb', line 10

def types
  @types
end

#types_delimiterObject

Returns the value of attribute types_delimiter.



10
11
12
# File 'lib/fluent/mixin/type_converter.rb', line 10

def types_delimiter
  @types_delimiter
end

#types_label_delimiterObject

Returns the value of attribute types_label_delimiter.



10
11
12
# File 'lib/fluent/mixin/type_converter.rb', line 10

def types_label_delimiter
  @types_label_delimiter
end

Instance Method Details

#configure(conf) ⇒ Object



12
13
14
15
# File 'lib/fluent/mixin/type_converter.rb', line 12

def configure(conf)
  super

end

#convert_field_type!(record) ⇒ Object



24
25
26
27
28
29
# File 'lib/fluent/mixin/type_converter.rb', line 24

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

#filter_record(tag, time, record) ⇒ Object



17
18
19
20
21
22
# File 'lib/fluent/mixin/type_converter.rb', line 17

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