Splunk Search

How to get proper _time extraction for 2 different date formats in a single sourcetype?

garryclarke
Path Finder

I have a SPLUNK 6.2 instance ingesting data with the following 2 date formats using a single sourcetype.

01/12/14,14:30:11,00:00:00:00,83,00,00000,0404,02920881500,07088830091
30:11:2014,19:45:30,00:00:05:45,84,21,00010,0225,00006323653,00066388663

In both cases SPLUNK is able to correctly extract all fields from the comma delimited row and correctly identify them as events.
However in the case of the first line of data SPLUNK is able to extract the date and time of 01/12/2014 @ 14:30:11 and store it as the time against the event.
However for the second record SPLUNK is not assigning the correct data and time and is using a date and time of 01/12/2014 @ 19:45:30
It would seem that it is not able to correctly identify the date correctly when it is delimited with : characters.

The only additional configuration I have carried out is adding the following
TIME_PREFIX = ^
Could anyone point me in the direction of where I need to look in order to fix this?

1 Solution

gfuente
Motivator

Hello

You need to create a custom datetime.xml, you can follow this tutorial to get it:

http://www.function1.com/2013/01/oh-no-splunking-log-files-with-multiple-formats-no-problem/

Regards

View solution in original post

gfuente
Motivator

Hello

You need to create a custom datetime.xml, you can follow this tutorial to get it:

http://www.function1.com/2013/01/oh-no-splunking-log-files-with-multiple-formats-no-problem/

Regards

garryclarke
Path Finder

Although I like the solution you detailed above gfuente, it will be useful in the future, I went back to source and ensured that the sending system was sending me data in the same format for all records.

0 Karma
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...