Getting Data In

timestamp recognition in multi timestamp event

lukasz92
Communicator

Hi all!

I have a problem with my log. Some events have only one timestamp, some have two - as in this example : http://docs.splunk.com/Documentation/Splunk/6.2.1/Data/Configurepositionaltimestampextraction#Exampl...

How should I configure splunk to always match the latest timestamp in the event?
I could write regex, but I only can provide time PREFIX (TIME_PREFIX=...). If I write a TIME_PREFIX for two-timestamps-event - some events (with only one timestamp) will have incorrect time (time of indexing)

Tags (2)
0 Karma
1 Solution

lukasz92
Communicator

I solved my problem with using one, more complicated regex - with question mark match: ()?
TIME_PREFIX = (.*something123 (\[)?([^,]*, somethingother[^,]*,[^,]*, [^0-9]*)?)?
It was possible with my custom data.

@FritzWittwer
I haven't tried your solution, maybe it works.

I will keep the question open, for other ideas.

View solution in original post

0 Karma

lukasz92
Communicator

I solved my problem with using one, more complicated regex - with question mark match: ()?
TIME_PREFIX = (.*something123 (\[)?([^,]*, somethingother[^,]*,[^,]*, [^0-9]*)?)?
It was possible with my custom data.

@FritzWittwer
I haven't tried your solution, maybe it works.

I will keep the question open, for other ideas.

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Can you provide some samples of your events (mask sensitive information) with both single and double timestamp values.?

0 Karma

FritzWittwer_ol
Contributor

I would try it with a regexp with a two alternatives, one with a positive look ahead (?=…second time stamp regexp…)so it only matches if there is a second timestamp, did not try it out, but I think this could work.

0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...