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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...