{"record":{"id":"ae4e7d110438bf5f","repo":"fluent/fluentd","slug":"whitespace-character-is-not-allowed-in-dot-notatio","errorCode":null,"errorMessage":"whitespace character is not allowed in dot notation. Use bracket notation: #{key}","messagePattern":"whitespace character is not allowed in dot notation\\. Use bracket notation: #(.+?)","errorType":"exception","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin_helper/record_accessor.rb","lineNumber":123,"sourceCode":"          keys.each { |key|\n            if key.include?('[')\n              result.concat(parse_dot_array_op(key, param))\n            else\n              result << key\n            end\n          }\n\n          raise Fluent::ConfigError, \"empty keys in dot notation\" if result.empty?\n          validate_dot_keys(result)\n\n          result\n        end\n\n        def self.validate_dot_keys(keys)\n          keys.each { |key|\n            next unless key.is_a?(String)\n            if /\\s+/.match?(key)\n              raise Fluent::ConfigError, \"whitespace character is not allowed in dot notation. Use bracket notation: #{key}\"\n            end\n          }\n        end\n\n        def self.parse_dot_array_op(key, param)\n          start = key.index('[')\n          result = if start.zero?\n                     []\n                   else\n                     [key[0..start - 1]]\n                   end\n          key = key[start + 1..-1]\n          in_bracket = true\n\n          until key.empty?\n            if in_bracket\n              if i = key.index(']')\n                index_value = key[0..i - 1]","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin_helper/record_accessor.rb#L105-L141","documentation":"Fluent::ConfigError from Fluent::RecordAccessor's validate_dot_keys. In dot notation each path segment must be free of whitespace (checked with /\\s+/), because a key containing spaces cannot be expressed unambiguously in dot form. The message tells you to switch to bracket notation for that key.","triggerScenarios":"record_accessor_create with a dot-notation path whose key contains whitespace: $.my key, $.log level, or a trailing/leading space like $.foo .","commonSituations":"Record keys derived from log field names, HTTP headers or user-supplied labels that contain spaces; copy-pasting a key with an invisible trailing space into a config value.","solutions":["Switch the offending key to bracket notation: $['my key'] instead of $.my key","Strip or normalize keys before composing dot-notation paths","Check for invisible trailing/leading whitespace in the config value (the message includes the offending key)"],"exampleFix":"# before\naccessor = record_accessor_create('$.my key')\n\n# after\naccessor = record_accessor_create(\"$['my key']\")","handlingStrategy":"validation","validationCode":"# reject whitespace before Fluent does, and switch to bracket form\nkeys = param[2..-1].split('.')\nif keys.any? { |k| k.match?(%r{\\s}) }\n  param = \"$['#{keys.join('.')}']\"\nend\naccessor = record_accessor_create(param)","typeGuard":null,"tryCatchPattern":"begin\n  record_accessor_create(param)\nrescue Fluent::ConfigError => e\n  param = param.gsub(/\\s+/, '_')\n  retry_count ||= 0\n  (retry_count += 1) < 2 ? retry : raise\nend","preventionTips":["Prefer bracket notation whenever keys originate outside your code","Strip whitespace from keys before composing paths","Quote any key that can contain spaces: $['my key']]"],"tags":["fluentd","record-accessor","dot-notation","whitespace"],"backgroundTag":"invalid-path-expression","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}