{"record":{"id":"c68741ffef3cea92","repo":"fluent/fluentd","slug":"buffer-argument-includes-time-but-timekey","errorCode":null,"errorMessage":"<buffer ...> argument includes 'time', but timekey is not configured","messagePattern":"<buffer \\.\\.\\.> argument includes 'time', but timekey is not configured","errorType":"validation","errorClass":"Fluent::ConfigError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin/output.rb","lineNumber":330,"sourceCode":"                  k !~ CHUNK_KEY_PATTERN\n                else\n                  if key.start_with?('$[')\n                    raise Fluent::ConfigError, \"in chunk_keys: bracket notation is not allowed\"\n                  else\n                    false\n                  end\n                end\n              rescue => e\n                raise Fluent::ConfigError, \"in chunk_keys: #{e.message}\"\n              end\n            }\n            raise Fluent::ConfigError, \"chunk_keys specification includes invalid char\"\n          else\n            @chunk_key_accessors = Hash[@chunk_keys.map { |key| [key.to_sym, Fluent::PluginHelper::RecordAccessor::Accessor.new(key)] }]\n          end\n\n          if @chunk_key_time\n            raise Fluent::ConfigError, \"<buffer ...> argument includes 'time', but timekey is not configured\" unless @buffer_config.timekey\n            Fluent::Timezone.validate!(@buffer_config.timekey_zone)\n            @timekey_zone = @buffer_config.timekey_use_utc ? '+0000' : @buffer_config.timekey_zone\n            @timekey = @buffer_config.timekey\n            if @timekey <= 0\n              raise Fluent::ConfigError, \"timekey should be greater than 0. current timekey: #{@timekey}\"\n            end\n            @timekey_use_utc = @buffer_config.timekey_use_utc\n            @offset = Fluent::Timezone.utc_offset(@timekey_zone)\n            @calculate_offset = @offset.respond_to?(:call) ? @offset : nil\n            @output_time_formatter_cache = {}\n          end\n\n          if (@chunk_key_tag ? 1 : 0) + @chunk_keys.size >= CHUNKING_FIELD_WARN_NUM\n            log.warn \"many chunk keys specified, and it may cause too many chunks on your system.\"\n          end\n\n          # no chunk keys or only tags (chunking can be done without iterating event stream)\n          @simple_chunking = !@chunk_key_time && @chunk_keys.empty?","sourceCodeStart":312,"sourceCodeEnd":348,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin/output.rb#L312-L348","documentation":"The buffer section lists `time` as a chunk key but no `timekey` was configured. `timekey` defines the time window (e.g. 1h) over which records are grouped into one chunk, and it is mandatory whenever `time` chunking is used — without it Fluentd cannot compute chunk boundaries or expand time placeholders.","triggerScenarios":"`<buffer time>` with no `timekey` line in the same buffer block. The check `unless @buffer_config.timekey` at output.rb:330 fires during `#configure` of any buffered output (file, s3, forward with time key, etc.).","commonSituations":"Users copy a time-chunked `<buffer>` example but trim the `timekey` line; migration from v0.12 `time_slice_format`-based configs where the format string implied the window; adding `time` while editing a tag-keyed buffer.","solutions":["Add a `timekey` to the buffer section matching the granularity you need (e.g. `timekey 1h`)","Add `timekey_zone` if records must be bucketed in a local timezone","Keep `time` in chunk keys only if you actually want time-based rotation; otherwise remove it"],"exampleFix":"# before\n<buffer time>\n  @type file\n</buffer>\n\n# after\n<buffer time>\n  @type file\n  timekey 1h\n  timekey_zone +09:00\n</buffer>","handlingStrategy":"validation","validationCode":"fluentd --dry-run -c /etc/fluent/fluent.conf\n# quick lint: every '<buffer ...time' block needs a timekey line in the same section","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Whenever you add `time` to chunk keys, add `timekey` in the same edit","Keep example buffer blocks in your repo as reviewed snippets","Set timekey_zone explicitly for local-time bucketing"],"tags":["fluentd","buffer","timekey","configuration"],"backgroundTag":"missing-required-parameter","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}