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.

View solution in original post

yannK
Splunk Employee
Splunk Employee

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

0 Karma
Did you miss .conf21 Virtual?

Good news! The event's keynotes and many of its breakout sessions are now available online, and still totally FREE!