Admin Manual

 


Authentication

Correct timestamp recognition

This documentation does not apply to the most recent version of Splunk. Click here for the latest version.

Correct timestamp recognition

Whenever the Splunk Server begins to index a new source, it sets timestamps in this order:


If Splunk is not extracting the timestamp in an event correctly, you can either create a custom datetime.xml file that instructs Splunk how to recognize that timestamp, OR you can add new timestamp rules to the default datetime.xml file.


etc/bundles/local/props.conf

This example would tell Splunk to use a custom timestamp parser, modified from the default $SPLUNK_HOME/etc/datetime.xml .


[my_custom_sourcetype]
DATETIME_CONFIG = /etc/custom_datetime.xml

Attributes

Filename


Default: /etc/datetime.xml


The configuration file that specifies the patterns Splunk should treat as dates and times. The path is prefixed by $SPLUNK_HOME .


Training Splunk to Recognize Timestamps

Splunk's commandline interface provides an interactive timestamp training process that produces regex-based expressions to be added to the datetime.xml file.


splunk train dates

Positional timestamp extraction

If your event contains more than one timestamp you have the option of telling which one the Splunk Server should extract when setting its timestamp. This is especially useful with events that contain syslog host-chaining.


Positional timestamp extraction is configured in $SPLUNK_HOME/etc/bundles/local/props.conf using the following directive:


    [source::<path>]
    TIME_PREFIX = <regex> 

The regular expression should match on whatever data immediately precedes the desired timestamp.

This documentation applies to the following versions of Splunk: 2.1 , 2.2 , 2.2.1 , 2.2.3 , 2.2.6 View the Article History for its revisions.


You must be logged into splunk.com in order to post comments. Log in now.

Was this documentation topic helpful?

If you'd like to hear back from us, please provide your email address:

We'd love to hear what you think about this topic or the documentation as a whole. Feedback you enter here will be delivered to the documentation team.

Feedback submitted, thanks!