Module: Fluent::Mixin::TypeConverter
- Includes:
- Configurable, TextParser::TypeConverter, RecordFilterMixin
- Defined in:
- lib/fluent/mixin/type_converter.rb
Instance Attribute Summary collapse
-
#types ⇒ Object
Returns the value of attribute types.
-
#types_delimiter ⇒ Object
Returns the value of attribute types_delimiter.
-
#types_label_delimiter ⇒ Object
Returns the value of attribute types_label_delimiter.
Instance Method Summary collapse
- #configure(conf) ⇒ Object
- #convert_field_type!(record) ⇒ Object
- #filter_record(tag, time, record) ⇒ Object
Instance Attribute Details
#types ⇒ Object
Returns the value of attribute types.
8 9 10 |
# File 'lib/fluent/mixin/type_converter.rb', line 8 def types @types end |
#types_delimiter ⇒ Object
Returns the value of attribute types_delimiter.
8 9 10 |
# File 'lib/fluent/mixin/type_converter.rb', line 8 def types_delimiter @types_delimiter end |
#types_label_delimiter ⇒ Object
Returns the value of attribute types_label_delimiter.
8 9 10 |
# File 'lib/fluent/mixin/type_converter.rb', line 8 def types_label_delimiter @types_label_delimiter end |
Instance Method Details
#configure(conf) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/fluent/mixin/type_converter.rb', line 10 def configure(conf) super if types = conf['types'] @types = types end if types_delimiter = conf['types_delimiter'] @types_delimiter = types_delimiter end if types_label_delimiter = conf['types_label_delimiter'] @types_label_delimiter = types_label_delimiter end end |
#convert_field_type!(record) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/fluent/mixin/type_converter.rb', line 33 def convert_field_type!(record) record.each { |key, value| record[key] = convert_type(key, value) } self end |
#filter_record(tag, time, record) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/fluent/mixin/type_converter.rb', line 26 def filter_record(tag, time, record) super if @types convert_field_type!(record) end end |