Skip to Content
KubeSense
Logs/Log Pipelines/Timestamp Extract

Timestamp Extract

The Timestamp Extract rule replaces the log's ingestion timestamp with a timestamp parsed from a field within the log itself. This ensures that time-based searches and visualizations reflect when the event actually occurred, not when it was received.

When to Use

  • There is a delay between when your application generates a log and when it is ingested by KubeSense.
  • Your logs contain an application-generated timestamp that is more accurate than the ingestion time.
  • You need precise event ordering for debugging distributed systems.

Fields

FieldRequiredDescription
NameYesRule identifier
Source FieldYesThe log field containing the timestamp value
Time FormatYesThe format string used to parse the timestamp

How It Works

The rule reads the value from the source field, parses it using the specified time format, and overwrites the log's timestamp with the parsed value. If parsing fails, the original ingestion timestamp is preserved.

Timestamp Extract Rule Configuration

Time Format Reference

The time format uses strftime directives. Here are common formats:

Format StringExample Value
%Y-%m-%dT%H:%M:%S%:z2026-03-10T13:55:36+00:00
%Y-%m-%dT%H:%M:%S%.3fZ2026-03-10T13:55:36.123Z
%Y-%m-%d %H:%M:%S2026-03-10 13:55:36
%d/%b/%Y:%H:%M:%S %z10/Mar/2026:13:55:36 +0000
%a %b %e %H:%M:%S %YTue Mar 10 13:55:36 2026

Examples

ISO 8601 Timestamp

  • Source Field: event_time
  • Time Format: %Y-%m-%dT%H:%M:%S%:z

Parses values like 2026-03-10T13:55:36Z or 2026-03-10T13:55:36+05:30.

Custom Application Timestamp

  • Source Field: app_timestamp
  • Time Format: %Y-%m-%d %H:%M:%S%.3f

Parses values like 2026-03-10 13:55:36.789.

Apache Log Timestamp

  • Source Field: timestamp
  • Time Format: %d/%b/%Y:%H:%M:%S %z

Parses values like 10/Mar/2026:13:55:36 +0000.

Tips

  • If your logs are unstructured text, use a Parse rule first to extract the timestamp into a named field, then apply Timestamp Extract on that field.
  • The time format must match the timestamp value exactly — including separators, timezone format, and decimal precision.
  • When in doubt, test with a few sample log entries before saving.

On this page