Getting Data In

How do I check if my custom TIME_FORMAT is successfully parsing the time stamps of my events?

hexx
Splunk Employee
Splunk Employee

I am using TIME_FORMAT (see props.conf.spec for reference) in an attempt to accelerate the date-time parsing of my events, but I have no way to know if the strptime format I specified is successfully matching the time stamp string in my events and therefore avoiding all of the regular expression matching in $SPLUNK_HOME/etc/datetime.xml.

Is there any way that I could find out if my TIME_FORMAT is correct?

1 Solution

jrodman
Splunk Employee
Splunk Employee

In versions of Splunk 4.3 and above, Data Preview will identify TIME_FORMAT failures for you, allowing interactive editing/testing cycles TIME_FORMAT in data preview, or simply testing if your existing TIME_FORMAT in props.conf is operating.

Data Preview displaying strptime failure tooltip


In versions of Splunk 4.2 and earlier, there is no particular great workflow method. One method is to, for your particular sourcetype in props.conf, set DATETIME_CONFIG = /etc/null_datetime.xml with an xml file such as:

<datetime>
    <timePatterns>
    </timePatterns>
    <datePatterns>
    </datePatterns>
</datetime>

An alternate method is to change the log level for DateParserVerbose to DEBUG, which will cause strptime failures to be written to splunkd.log. This is very verbose however, so not recommended for high volume environments.

View solution in original post

jrodman
Splunk Employee
Splunk Employee

In versions of Splunk 4.3 and above, Data Preview will identify TIME_FORMAT failures for you, allowing interactive editing/testing cycles TIME_FORMAT in data preview, or simply testing if your existing TIME_FORMAT in props.conf is operating.

Data Preview displaying strptime failure tooltip


In versions of Splunk 4.2 and earlier, there is no particular great workflow method. One method is to, for your particular sourcetype in props.conf, set DATETIME_CONFIG = /etc/null_datetime.xml with an xml file such as:

<datetime>
    <timePatterns>
    </timePatterns>
    <datePatterns>
    </datePatterns>
</datetime>

An alternate method is to change the log level for DateParserVerbose to DEBUG, which will cause strptime failures to be written to splunkd.log. This is very verbose however, so not recommended for high volume environments.

yannK
Splunk Employee
Splunk Employee

All those years, it was there, just under my nose!

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...