{"record":{"id":"5af34a405e4ddae2","repo":"fluent/fluentd","slug":"found-more-characters-after-invalid-syntax-5af34a","errorCode":null,"errorMessage":"found more characters after ']'. Invalid syntax: #{orig_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":195,"sourceCode":"                  raise Fluent::ConfigError, \"Incomplete bracket. Invalid syntax: #{orig_param}\"\n                end\n              else\n                if i = param.index(']')\n                  index_value = param[0..i - 1]\n                  raise Fluent::ConfigError, \"missing array index in '[]'. Invalid syntax: #{param}\" if index_value == ']'\n                  result << Integer(index_value)\n                  param = param[i + 1..-1]\n                  in_bracket = false\n                else\n                  raise Fluent::ConfigError, \"'[' found but ']' not found. Invalid syntax: #{orig_param}\"\n                end\n              end\n            else\n              if i = param.index('[')\n                param = param[i + 1..-1]\n                in_bracket = true\n              else\n                raise Fluent::ConfigError, \"found more characters after ']'. Invalid syntax: #{orig_param}\"\n              end\n            end\n          end\n\n          raise Fluent::ConfigError, \"empty keys in bracket notation\" if result.empty?\n\n          result\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":177,"sourceCodeEnd":208,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin_helper/record_accessor.rb#L177-L208","documentation":"Fluent::ConfigError from Fluent::RecordAccessor's parse_bracket_notation. After a ']' closes a bracket, the only legal next character is '[' (another level) or end-of-string; any other trailing characters are rejected as garbage after the closing bracket.","triggerScenarios":"record_accessor_create with a bracket-notation path that has loose characters after a closed bracket: $[0]foo, $['a']bar].","commonSituations":"Concatenating path pieces and forgetting the next '['; intending $[0]['foo'] but writing $[0]foo.","solutions":["Wrap the next segment in brackets: $[0]['foo']","Quote string segments: $[0]['foo'] distinguishes keys from indexes","Check the printed param in the message to see exactly which characters are extra"],"exampleFix":"# before\naccessor = record_accessor_create(\"$[0]name\")\n\n# after\naccessor = record_accessor_create(\"$[0]['name']\")","handlingStrategy":"try-catch","validationCode":"null","typeGuard":null,"tryCatchPattern":"begin\n  Fluent::RecordAccessor::Accessor.new(param)\nrescue Fluent::ConfigError => e\n  raise ArgumentError, \"trailing characters in #{param.inspect}: #{e.message}\"\nend","preventionTips":["Chain segments with explicit brackets: $[0]['k']","Avoid string concatenation when composing accessor paths; keep segments in a list"],"tags":["fluentd","record-accessor","bracket-notation","syntax"],"backgroundTag":"invalid-path-expression","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}