Getting Data In

Events has wrong timestamp, How to correct time config?

iamsplunker
Communicator

Hello Splunkers, 

I've an issue with my event time configuration. It has incorrect timestamp. Below are my props settings..it doesn't seem to be working. Please Advise

TIME_FORMAT = %Y-%m-%d %H:%M:%S

TIME_PREFIX = ^

TZ = UTC-4

MAX_TIMESTAMP_LOOKAHEAD = 20 

 

Sample log format

Time                                                                      Event
6/27/21 8:30:56.000 PM                #Software: banana Internet Information Services 19.0
                                                                   #Version: 10.0
                                                                   #Date: 2021-06-27 20:32:46
                                                                   #Fields: Sacramento is the capital of California


6/27/21 8:30:56.000 PM                 #Software: pineapple Internet Information Services 39.0
                                                                    #Version: 12.0
                                                                    #Date: 2021-06-27 20:32:46
                                                                    #Fields: Austin is the capital of Texas

 

 

Labels (1)
Tags (2)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @iamsplunker,

as @jamie00171 said, the TIME_PREFIX is wrong, please try this:

TIME_PREFIX = \#Date:\s+

Ciao.

Giuseppe

0 Karma

iamsplunker
Communicator

@gcusello@jamie00171 Thanks. Looks like I've different events. For ex: Some events starts with 

2021-06-27 19:20:40  .....   and few events starts with 

                                                                    #Software: pineapple Internet Information Services 39.0
                                                                    #Version: 12.0
                                                                    #Date: 2021-06-27 20:32:46
                                                                    #Fields: Austin is the capital of Texas

 

does this TIME_PREFIX work ?

 

TIME_PREFIX = ^|\#Date:\s+

 

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @iamsplunker,

if you have different formats, maybe you have different logs with same sourcetype, so the best approach is to clearly identify sourcetype for each type of events and use the correct sourcetype to each data flow.

Anyway, please try this (I'm not sure that works!)

TIME_PREFIX = ^|(.*\#Date:\s+)

Ciao.

Giuseppe

0 Karma

isoutamo
SplunkTrust
SplunkTrust

If this didn’t work you could use INGEST_EVAL on transforms.conf. 1st try to pick _time as normal way and if it didn’t succeed then use INGEST_EVAL. You could found some examples from answers like https://community.splunk.com/t5/Getting-Data-In/Index-time-extraction-and-non-indexed-field/m-p/5777...

r. Ismo

0 Karma

jamie00171
Communicator

Hi @iamsplunker 

If you set TIME_PREFIX to ^ - I assume that means you are asking Splunk to look at the start of the event for the timestamp, however that doesn't seem to be where it is located, try changing the prefix to Date: and increasing the look ahead slightly.

Thanks, 

Jamie

0 Karma
Get Updates on the Splunk Community!

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...

Splunk App Dev Community Updates – What’s New and What’s Next

Welcome to your go-to roundup of everything happening in the Splunk App Dev Community! Whether you're building ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco + Splunk! We’ve ...