{"record":{"id":"73d5716d25d7585a","repo":"fluent/fluentd","slug":"found-but-not-found-invalid-syntax-ori","errorCode":null,"errorMessage":"'[' found but ']' not found. Invalid syntax: #{orig_param}","messagePattern":"'\\[' found but '\\]' not found\\. Invalid syntax: #(.+?)","errorType":"exception","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin_helper/record_accessor.rb","lineNumber":187,"sourceCode":"            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]\n                  result << param[1..i - 1]\n                  param = param[i + 2..-1]\n                  in_bracket = false\n                else\n                  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","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin_helper/record_accessor.rb#L169-L205","documentation":"Fluent::ConfigError from Fluent::RecordAccessor's parse_bracket_notation. Once inside brackets with an unquoted value, the parser requires a ']' to close the index; a path ending before it, like $[0 or $[12, is incomplete and rejected with the original parameter echoed.","triggerScenarios":"record_accessor_create with a bracket-notation path whose last bracket never closes: $[0, $[1]['k, $[\"a\"][2 (only the numeric bracket is unclosed in valid cases).","commonSituations":"Hand-trimming paths when editing configs and dropping the final ']'; programmatic path assembly that appends an index without the closer.","solutions":["Close the bracket: $[0]","Use the equivalent dot form for indexes on nested fields: $.arr[0]","Lint generated accessor paths for balanced brackets"],"exampleFix":"# before\naccessor = record_accessor_create('$[1')\n\n# after\naccessor = record_accessor_create('$[1]')","handlingStrategy":"validation","validationCode":"raise ArgumentError, 'unbalanced brackets in path' if param.count('[') != param.count(']')\naccessor = record_accessor_create(param)","typeGuard":null,"tryCatchPattern":"begin\n  Fluent::RecordAccessor::Accessor.new(param)\nrescue Fluent::ConfigError => e\n  raise ArgumentError, \"unclosed bracket in #{param.inspect}\"\nend","preventionTips":["Append opener and closer for brackets in the same statement","Lint generated paths for balanced brackets"],"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"}