{"record":{"id":"b479d12140aa5750","repo":"fluent/fluentd","slug":"parameter-name-string-doesn-t-have-timest-b479d1","errorCode":null,"errorMessage":"Parameter '#{name}: #{string}' doesn't have timestamp placeholder for #{title}('#{example}') for timekey #{timekey.to_i}","messagePattern":"Parameter '#(.+?): #(.+?)' doesn't have timestamp placeholder for #(.+?)\\('#(.+?)'\\) for timekey #(.+?)","errorType":"exception","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin/output.rb","lineNumber":739,"sourceCode":"          when :time then validate_time!\n          when :tag  then validate_tag!\n          when :keys then validate_keys!\n          end\n        end\n\n        def validate_time!\n          sec = @argument[:sec]\n          title = @argument[:title]\n          example = @argument[:example]\n          timekey = @argument[:timekey]\n          if !sec && timekey\n            raise Fluent::ConfigError, \"Parameter '#{name}: #{string}' doesn't have timestamp placeholders for timekey #{timekey.to_i}\"\n          end\n          if sec && !timekey\n            raise Fluent::ConfigError, \"Parameter '#{name}: #{string}' has timestamp placeholders, but chunk key 'time' is not configured\"\n          end\n          if sec && timekey && timekey < sec\n            raise Fluent::ConfigError, \"Parameter '#{name}: #{string}' doesn't have timestamp placeholder for #{title}('#{example}') for timekey #{timekey.to_i}\"\n          end\n        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","sourceCodeStart":721,"sourceCodeEnd":757,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin/output.rb#L721-L757","documentation":"The time directives present in the parameter are coarser than the timekey: `get_placeholders_time` computes the granularity (`sec`) of the finest directive in the string (e.g. only `%d` → 86400s), and `timekey < sec` means several distinct chunks would render the same path value. The error names the coarsest offender via `title`/`example` (e.g. day('%d')) and the configured timekey.","triggerScenarios":"`timekey 1h` with `path /logs/app.%Y%m%d.log` (finest directive is %d = 86400s > 3600s); `timekey 30s` with only `%Y%m%d%H`; any combination where the path varies slower than the chunk window.","commonSituations":"Tightening `timekey` for smaller files (1d → 1h) without adding `%H` to the path; using a date-only filename inherited from an example with a per-hour timekey.","solutions":["Add a directive matching the timekey granularity: for 1h add `%H`, for 1m add `%M`, for 1s add `%S`","Or relax the timekey to match the path granularity (e.g. timekey 1d with a %Y%m%d path)","Double-check the mapping: %S=1s, %M=60s, %H=3600s, %d=86400s vs your timekey seconds"],"exampleFix":"# before\ntimekey 1h\npath /logs/app.%Y%m%d.log\n\n# after\ntimekey 1h\npath /logs/app.%Y%m%d%H.log","handlingStrategy":"validation","validationCode":"# Ruby pre-check: finest directive granularity must be <= timekey\nGRAN = { '%S' => 1, '%M' => 60, '%H' => 3600, '%d' => 86400 }\npath = '/logs/app.%Y%m%d.log'; timekey = 3600\nfinest = GRAN.values.select { |s| GRAN.any? { |d, v| v == s && path.include?(d) } }.min || 0\nabort 'path too coarse for timekey' if timekey < finest\nfluentd --dry-run -c /etc/fluent/fluent.conf","typeGuard":"def timekey_covers_path?(timekey, path)\n  gran = { '%S' => 1, '%M' => 60, '%H' => 3600, '%d' => 86400 }\n  finest = gran.select { |d, _| path.include?(d) }.values.min\n  finest.nil? || timekey >= finest\nend","tryCatchPattern":null,"preventionTips":["Memorize the ladder: %S=1s %M=60s %H=3600s %d=86400s; timekey must be >= the finest directive used","When tightening timekey, tighten the path in the same commit","Test with --dry-run; this check runs at configure"],"tags":["fluentd","placeholder","timekey","path","configuration"],"backgroundTag":"template-placeholder-mismatch","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}