16.2 Timestamp Extraction, Time Zones & Clock Skew Handling
Key Takeaways
- TIME_PREFIX limits the search to text after its first match (no match means no extraction), TIME_FORMAT gives the strptime layout, and MAX_TIMESTAMP_LOOKAHEAD (default 128) bounds the search from the prefix.
- Time zone order per props.conf.spec: a zone in the event's raw text first, then TZ in props.conf, then the forwarder's zone, then the zone of the system running splunkd.
- DATETIME_CONFIG = NONE keeps the input layer's time (a file's modification time for monitored files); CURRENT uses the time the event passes through the aggregator.
- When no timestamp is found, Splunk uses the previous event's time from the same source, then a date in the source name, then the file modification time, then the current time.
- MAX_DAYS_AGO (default 2000) and MAX_DAYS_HENCE (default 2) do not drop events; out-of-range dates get the last acceptable event's timestamp, or the current time if none exists.
Timestamp Extraction, Time Zones & Clock Skew Handling
Quick Summary: Every event's
_timeis stored as a UTC epoch value. Splunk finds the timestamp during the merging pipeline, usingdatetime.xmlpatterns unless you tell it exactly where and how to look withTIME_PREFIX,TIME_FORMAT, andMAX_TIMESTAMP_LOOKAHEAD. Know the time zone order fromprops.conf.spec(a zone in the event text, thenTZ, then the forwarder's zone, then the indexer's zone), whatDATETIME_CONFIG = NONEandCURRENTdo, the fallback when no timestamp is found, and howMAX_DAYS_AGOandMAX_DAYS_HENCEhandle implausible dates.
Timestamp Extraction in props.conf
Without specific settings, Splunk looks for a timestamp using the patterns in $SPLUNK_HOME/etc/datetime.xml (the default DATETIME_CONFIG). That works for many common formats, but it has costs:
- Performance: checking many patterns in every event is slower than parsing one known format.
- Wrong matches: numbers such as version strings, IDs, or IP-like values can be mistaken for dates, and the wrong date may be chosen when an event contains several.
Three settings make extraction precise and fast.
1. TIME_PREFIX = <regex>
- Splunk looks for a timestamp only in the text after the end of the first match of this regex.
- If
TIME_PREFIXis not found in the event, timestamp extraction does not occur for that event, and the fallback rules below apply. - Used together with
TIME_FORMAT, the prefix must match up to and including the character just before the date.
# Timestamp right after an opening bracket
TIME_PREFIX = ^\[
# Timestamp inside a key-value pair
TIME_PREFIX = timestamp="
2. TIME_FORMAT = <strptime-style format>
- Gives the exact
strptimelayout of the timestamp, read starting right afterTIME_PREFIX. - For good results, the format should describe both the date and the time of day.
| Directive | Meaning | Example |
|---|---|---|
%Y / %y | 4-digit / 2-digit year | 2026 / 26 |
%m | Month number (01–12) | 09 |
%b / %B | Abbreviated / full month name | Sep / September |
%d | Day of month (01–31) | 23 |
%H / %I | Hour, 24-hour / 12-hour | 14 / 02 |
%p | AM or PM | PM |
%M / %S | Minute / second | 35 / 10 |
%3N / %6N | Milliseconds / microseconds | 124 / 124512 |
%z | UTC offset | -0700 |
%Z | Time zone abbreviation | UTC, EST |
%s | Epoch seconds | 1790174110 |
3. MAX_TIMESTAMP_LOOKAHEAD = <integer>
- How many characters into the event, counted from the
TIME_PREFIXlocation, Splunk looks for the timestamp. IfTIME_PREFIXlands 11 characters in and the lookahead is 10, extraction is limited to characters 11 through 20. - Default:
128. 0or-1removes the limit, which the spec warns can hurt performance for long events.- Set it to about the length of the timestamp, for example 30 for an ISO 8601 string with milliseconds and offset.
Example: A Tuned Source Type
[app:json:audit]
SHOULD_LINEMERGE = false
LINE_BREAKER = ([\r\n]+)\{"timestamp":
TIME_PREFIX = \{"timestamp":"
TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%3N%z
MAX_TIMESTAMP_LOOKAHEAD = 30
TRUNCATE = 100000
Time Zone Resolution
Splunk stores _time in UTC and shows it in each user's time zone preference. To convert a timestamp to UTC, it decides the event's zone using the order defined in props.conf.spec for TZ:
1. A time zone in the event's raw text (for example UTC, -08:00, +0000)
| if none
v
2. The TZ setting in props.conf (for example TZ = America/Chicago)
| if not set
v
3. The time zone sent by the forwarder (6.0+ forwarding protocol)
| if not forwarded
v
4. The time zone of the system running splunkd (the parsing instance)
What This Means in Practice
TZdoes not override an explicit zone in the event. If the event says+0000, that offset is used even when the stanza setsTZ = America/Chicago.TZfixes events that carry no zone information.- Forwarded data defaults to the forwarder's zone. A universal forwarder in London sends its time zone with the data, so un-zoned timestamps from its files are interpreted as London time, even if the indexer is in New York.
- Direct network inputs have no forwarder zone. A London router sending BSD syslog (for example
Oct 14 04:12:01, with no year or zone) straight to a New York indexer is interpreted in the indexer's zone, and its events appear five hours off. Fix it withTZin a[host::<router>]or source type stanza. - Ambiguous abbreviations:
TZ_ALIAScontrols how zone strings found in event text are interpreted. For example,ESTmaps to US Eastern by default;TZ_ALIAS = EST=GMT+10:00changes that. It has no effect on theTZsetting.
DATETIME_CONFIG and Fallback Behavior
DATETIME_CONFIG
| Value | Behavior |
|---|---|
/etc/datetime.xml (default) | Normal timestamp extraction using datetime.xml patterns, or your TIME_* settings |
NONE | The timestamp extractor does not run. The event keeps the time chosen by the input layer: for forwarded data, the time chosen on the forwarder; for monitored or batch files, the file's modification time; for other inputs, the current system time when the data is read |
CURRENT | Every event gets the current system time at the point it passes through the aggregator (the merging pipeline) |
| A custom file path | Use a different datetime.xml, for example in an app |
Both NONE and CURRENT disable timestamp identification in the text. BREAK_ONLY_BEFORE_DATE then cannot find event boundaries, so the spec pairs them with SHOULD_LINEMERGE = false or explicit BREAK_ONLY_* and MUST_BREAK_* rules. The spec notes that turning timestamp extraction off can speed up indexing.
When No Timestamp Is Found
If extraction runs but finds nothing usable, Splunk falls back in this order:
- The timestamp of the previous event from the same source.
- If no events in the source have a date, a date found in the source or file name (the events need a time of day).
- For files, the file's modification time.
- As a last resort, the current system time when the event is indexed.
Guardrails: MAX_DAYS_AGO and MAX_DAYS_HENCE
Both limits are measured from the current date as provided by the input layer, such as the forwarder's current time or a file's modification time.
MAX_DAYS_AGO
- Default:
2000days (about 5.48 years). The highest legal value is10951(30 years). - An extracted date older than this is not trusted. The event is still indexed, with the timestamp of the last acceptable event, or the current time if there is none.
- Backfilling old archives: when loading data older than 2000 days, increase
MAX_DAYS_AGOfor that source type first. Otherwise, those events are stamped with other events' times.
MAX_DAYS_HENCE
- Default:
2days, which allows dates up to one day in the future. The highest legal value is10950. - A date further in the future gets the timestamp of the last acceptable event, or the current time if none exists.
- If servers have the wrong date, or are in a time zone a day ahead, the spec suggests increasing it to at least 3. A smaller window makes false positives less likely.
- Wildly wrong future dates are worth preventing, because they also stretch the time range of the bucket that holds them. That affects which searches must open the bucket and when time-based retention can freeze it.
Related: MAX_DIFF_SECS_AGO / MAX_DIFF_SECS_HENCE
These settings (defaults 3600 seconds and 604800 seconds) do not filter events. They make Splunk warn about timestamps that jump backward or forward compared with the previous event, and use a different format from most events in the source.
An event contains the raw string '2026-09-23 14:00:00 +0000', but props.conf specifies TZ = America/Chicago for that sourcetype. How does Splunk determine the time zone during indexing?
Which combination of parameters in props.conf eliminates heuristic regex evaluation in datetime.xml and bounds the character scan for optimal indexing performance?
An application writes events whose timestamps are 4 days in the future relative to the forwarder's clock. With default props.conf settings, how are these events timestamped?