{"record":{"id":"706e143b9c24137a","repo":"fluent/fluentd","slug":"parameter-name-string-doesn-t-have-enough","errorCode":null,"errorMessage":"Parameter '#{name}: #{string}' doesn't have enough placeholders for keys #{not_specified.join(',')}","messagePattern":"Parameter '#(.+?): #(.+?)' doesn't have enough placeholders for keys #(.+?)","errorType":"exception","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin/output.rb","lineNumber":759,"sourceCode":"        end\n\n        def validate_tag!\n          parts = @argument[:parts]\n          tagkey = @argument[:tagkey]\n          if tagkey && parts.empty?\n            raise Fluent::ConfigError, \"Parameter '#{name}: #{string}' doesn't have tag placeholder\"\n          end\n          if !tagkey && !parts.empty?\n            raise Fluent::ConfigError, \"Parameter '#{name}: #{string}' has tag placeholders, but chunk key 'tag' is not configured\"\n          end\n        end\n\n        def validate_keys!\n          keys = @argument[:keys]\n          chunk_keys = @argument[:chunkkeys]\n          if (chunk_keys - keys).size > 0\n            not_specified = (chunk_keys - keys).sort\n            raise Fluent::ConfigError, \"Parameter '#{name}: #{string}' doesn't have enough placeholders for keys #{not_specified.join(',')}\"\n          end\n          if (keys - chunk_keys).size > 0\n            not_satisfied = (keys - chunk_keys).sort\n            raise Fluent::ConfigError, \"Parameter '#{name}: #{string}' has placeholders, but chunk keys doesn't have keys #{not_satisfied.join(',')}\"\n          end\n        end\n      end\n\n      TIME_KEY_PLACEHOLDER_THRESHOLDS = [\n        [1, :second, '%S'],\n        [60, :minute, '%M'],\n        [3600, :hour, '%H'],\n        [86400, :day, '%d'],\n      ]\n      TIMESTAMP_CHECK_BASE_TIME = Time.parse(\"2016-01-01 00:00:00 UTC\")\n      # it's not validated to use timekey larger than 1 day\n      def get_placeholders_time(str)\n        base_str = TIMESTAMP_CHECK_BASE_TIME.strftime(str)","sourceCodeStart":741,"sourceCodeEnd":777,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin/output.rb#L741-L777","documentation":"Some buffer chunk keys have no corresponding `${key}` placeholder in the parameter (`(chunk_keys - keys).size > 0` in `validate_keys!`). Records with different values for the missing key would land in distinct chunks that render the identical path/value, silently merging data you asked to separate — so configure fails, listing the keys without placeholders.","triggerScenarios":"`<buffer tenant,env>` with `path /logs/${tenant}.log` — `env` has no `${env}` in the path; the error lists `env` via `not_specified.join(',')`. Applies to any placeholder-validated parameter missing placeholders for configured chunk keys.","commonSituations":"Adding a chunk key for cardinality control while the path template lags behind; deleting a `${key}` from the path during a refactor but leaving the key in the buffer line.","solutions":["Add the missing placeholder(s): `path /logs/${tenant}/${env}.log`","Or remove the unneeded key from the `<buffer ...>` chunk key list","Keep the two lists in sync in code review — the error names exactly which keys are missing"],"exampleFix":"# before\n<buffer tenant,env>\n  @type file\n</buffer>\npath /logs/${tenant}.log\n\n# after\n<buffer tenant,env>\n  @type file\n</buffer>\npath /logs/${tenant}/${env}.log","handlingStrategy":"validation","validationCode":"# keep chunk keys and path placeholders in sync\nchunk_keys = %w[tenant env]\npath = '/logs/${tenant}.log'\nused = path.scan(/\\$\\{([^}]+)\\}/).flatten - %w[tag chunk_id]\nmissing = chunk_keys - used\nabort \\\"chunk keys without placeholders: #{missing.join(', ')}\\\" unless missing.empty?\nfluentd --dry-run -c /etc/fluent/fluent.conf","typeGuard":"def placeholders_cover_chunk_keys?(chunk_keys, template)\n  used = template.scan(/\\$\\{([^}]+)\\}/).flatten - %w[tag chunk_id]\n  (chunk_keys - used).empty?\nend","tryCatchPattern":null,"preventionTips":["Review buffer chunk keys and path template as a pair","The error message lists exactly which keys lack placeholders — fix those, not others","Automate the set-comparison lint above in CI"],"tags":["fluentd","placeholder","chunk-keys","path","configuration"],"backgroundTag":"template-placeholder-mismatch","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}