{"record":{"id":"12dc52a2986467b7","repo":"fluent/fluentd","slug":"found-more-characters-after-invalid-syntax","errorCode":null,"errorMessage":"found more characters after ']'. Invalid syntax: #{param}","messagePattern":"found more characters after '\\]'\\. Invalid syntax: #(.+?)","errorType":"exception","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin_helper/record_accessor.rb","lineNumber":154,"sourceCode":"          in_bracket = true\n\n          until key.empty?\n            if in_bracket\n              if i = key.index(']')\n                index_value = key[0..i - 1]\n                raise Fluent::ConfigError, \"missing array index in '[]'. Invalid syntax: #{param}\" if index_value == ']'\n                result << Integer(index_value)\n                key = key[i + 1..-1]\n                in_bracket = false\n              else\n                raise Fluent::ConfigError, \"'[' found but ']' not found. Invalid syntax: #{param}\"\n              end\n            else\n              if i = key.index('[')\n                key = key[i + 1..-1]\n                in_bracket = true\n              else\n                raise Fluent::ConfigError, \"found more characters after ']'. Invalid syntax: #{param}\"\n              end\n            end\n          end\n\n          result\n        end\n\n        def self.parse_bracket_notation(param)\n          orig_param = param\n          result = []\n          param = param[1..-1]\n          in_bracket = false\n\n          until param.empty?\n            if in_bracket\n              if param[0] == \"'\" || param[0] == '\"'\n                if i = param.index(\"']\") || param.index('\"]')\n                  raise Fluent::ConfigError, \"Mismatched quotes. Invalid syntax: #{orig_param}\" unless param[0] == param[i]","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin_helper/record_accessor.rb#L136-L172","documentation":"Fluent::ConfigError from Fluent::RecordAccessor's parse_dot_array_op. After a closed array index in dot notation, the next character must be '[' (a further index) or nothing; trailing characters that are neither a new bracket nor empty mean garbage after ']' and the path is rejected.","triggerScenarios":"record_accessor_create with a dot-notation path that continues with bare characters after an index bracket: $.arr[0]bar, $.list[1]x[2] without dots/brackets in valid positions.","commonSituations":"Concatenating an index onto a key path and then appending a field name without a dot: intending $.arr[0].bar but writing $.arr[0]bar.","solutions":["Separate the next field with a dot: $.arr[0].bar","Chain further indexes as brackets: $.arr[0][1]","Re-read the message's printed param to find exactly where the extra characters start"],"exampleFix":"# before\naccessor = record_accessor_create('$.items[0]name')\n\n# after\naccessor = record_accessor_create('$.items[0].name')","handlingStrategy":"try-catch","validationCode":"null","typeGuard":null,"tryCatchPattern":"begin\n  accessor = Fluent::RecordAccessor::Accessor.new(param)\nrescue Fluent::ConfigError => e\n  # e.message contains the exact param; surface it to the config author\n  raise ConfigValidationError, \"fix path #{param.inspect}: #{e.message}\"\nend","preventionTips":["Join index and field with '.' when chaining: $.arr[0].field","Unit-test every accessor literal in plugin configs"],"tags":["fluentd","record-accessor","dot-notation","syntax"],"backgroundTag":"invalid-path-expression","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}