Getting Data In

Events has wrong timestamp, How to correct time config?

iamsplunker
Path Finder

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
Legend

Hi @iamsplunker,

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

TIME_PREFIX = \#Date:\s+

Ciao.

Giuseppe

0 Karma

iamsplunker
Path Finder

@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
Legend

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 Forwarders and Forced Time Based Load Balancing

Splunk customers use universal forwarders to collect and send data to Splunk. A universal forwarder can send ...

NEW! Log Views in Splunk Observability Dashboards Gives Context From a Single Page

Today, Splunk Observability releases log views, a new feature for users to add their logs data from Splunk Log ...

Last Chance to Submit Your Paper For BSides Splunk - Deadline is August 12th!

Hello everyone! Don't wait to submit - The deadline is August 12th! We have truly missed the community so ...