{"record":{"id":"2602fc4b3ebacaa3","repo":"fluent/fluentd","slug":"missing-array-index-in-invalid-syntax-par","errorCode":null,"errorMessage":"missing array index in '[]'. Invalid syntax: #{param}","messagePattern":"missing array index in '\\[\\]'\\. Invalid syntax: #(.+?)","errorType":"exception","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin_helper/record_accessor.rb","lineNumber":142,"sourceCode":"            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]\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","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin_helper/record_accessor.rb#L124-L160","documentation":"Fluent::ConfigError from Fluent::RecordAccessor's parse_dot_array_op. Inside dot notation an array index must be an integer between brackets; when the bracket content is empty (index_value == ']'), i.e. '[]', the parser raises because no index was supplied.","triggerScenarios":"record_accessor_create with a dot-notation path containing an empty bracket: $.array[], $.list[].field or $.[].","commonSituations":"Writing a wildcard-style '[]' expecting 'all elements' (record_accessor has no wildcard; use a filter with record_accessor per element); typos when converting $[0]-style paths to dot notation.","solutions":["Replace [] with a concrete index: $.array[0]","If you meant 'iterate all elements', do the iteration in a filter/record_transformer ruby block instead of the accessor path","Use pure bracket notation $[0] for top-level array indexing"],"exampleFix":"# before\naccessor = record_accessor_create('$.items[]')\n\n# after\naccessor = record_accessor_create('$.items[0]')","handlingStrategy":"try-catch","validationCode":"# reject empty index brackets up front\nraise ArgumentError, 'array index required in path' if param.include?('[]')\naccessor = record_accessor_create(param)","typeGuard":null,"tryCatchPattern":"begin\n  accessor = Fluent::RecordAccessor::Accessor.new(param)\nrescue Fluent::ConfigError => e\n  raise ArgumentError, \"invalid record path #{param.inspect}: #{e.message}\"\nend","preventionTips":["Remember record_accessor has no 'all elements' wildcard","Always emit a concrete integer inside [] when generating paths"],"tags":["fluentd","record-accessor","array-index","dot-notation"],"backgroundTag":"invalid-path-expression","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}