fluent/fluentd · error · Fluent::ConfigError

unknown value conversion for key:'#{field_name}', type:'#{ty

Error message

unknown value conversion for key:'#{field_name}', type:'#{type}'

What it means

Parser#build_type_converters (lib/fluent/plugin/parser.rb:236) validates the types config of any parser plugin and raises Fluent::ConfigError for an unknown type name. Valid types are exactly 'string', 'integer', 'float', 'bool', 'time', 'array' (AVAILABLE_PARSER_VALUE_TYPES, parser.rb:98); the part before the first ':' is the type, everything after is its option. This fails during configure, before any data is processed.

Source

Thrown at lib/fluent/plugin/parser.rb:236

        return time, record
      end

      def string_like_null(value, null_empty_string = @null_empty_string, null_value_regexp = @null_value_pattern)
        null_empty_string && value.empty? || null_value_regexp && string_safe_encoding(value){|s| null_value_regexp.match?(s) }
      end

      TRUTHY_VALUES = ['true', 'yes', '1']

      def build_type_converters(types)
        return nil unless types

        converters = {}

        types.each_pair do |field_name, type_definition|
          type, option = type_definition.split(":", 2)
          unless AVAILABLE_PARSER_VALUE_TYPES.include?(type)
            raise Fluent::ConfigError, "unknown value conversion for key:'#{field_name}', type:'#{type}'"
          end

          conv = case type
                 when 'string' then ->(v){ v.to_s }
                 when 'integer' then ->(v){ v.to_i rescue v.to_s.to_i }
                 when 'float' then ->(v){ v.to_f rescue v.to_s.to_f }
                 when 'bool' then ->(v){ TRUTHY_VALUES.include?(v.to_s.downcase) }
                 when 'time'
                   # comma-separated: time:[timezone:]time_format
                   # time_format is unixtime/float/string-time-format
                   timep = if option
                             time_type = 'string' # estimate
                             timezone, time_format = option.split(':', 2)
                             unless Fluent::Timezone.validate(timezone)
                               timezone, time_format = nil, option
                             end
                             if Fluent::TimeMixin::TIME_TYPES.include?(time_format)
                               time_type, time_format = time_format, nil # unixtime/float

View on GitHub (pinned to dd45c6e18d)

Solutions

  1. Correct the type name to one of string, integer, float, bool, time, array.
  2. For timestamps use the 'time' type with an option: types ts:'time:%Y-%m-%dT%H:%M:%S%z' or time_type/time_format in the parse block.
  3. Validate the config before deploy with fluentd --dry-run -c /etc/fluent/fluent.conf.
  4. Check for empty entries: every key in types must be 'name:type[:option]'.

Example fix

# before
<parse>
  @type json
  types user_id:integer, enabled:boolean, created_at:datetime
</parse>
# after
<parse>
  @type json
  types user_id:integer, enabled:bool, created_at:time
  time_format %Y-%m-%dT%H:%M:%S%z
</parse>
Defensive patterns

Strategy: validation

Validate before calling

# config lint before deploy
require 'yaml'
VALID = %w[string integer float bool time array]
def lint_types(types_string)
  types_string.split(',').each do |pair|
    k, t = pair.split(':', 2)
    abort "invalid types entry: #{pair}" unless k && VALID.include?(t)
  end
end

Prevention

When it happens

Trigger: Config such as <parse> @type json types user_id:integer,enabled:boolean </parse> ('boolean' invalid, must be 'bool'); types created_at:datetime or ts:date; a typo like interger; leaving a stray value without a type (types field1:), which splits to type '' and also fails.

Common situations: Porting configs from other tools that use 'boolean'/'datetime'/'long' type names; JSON parser users typing string type names from schemas (Avro/Protobuf style); forgetting that complex types go through 'array'/'time' with options rather than distinct names; trailing commas or empty entries in the types map.

Related errors


AI-assisted analysis of fluent/fluentd@dd45c6e18d (2026-08-21). Data as JSON: /api/errors/047db17436a4e65f. Report an issue: GitHub.