Getting Data In

How to do custom timestamp parsing?

the_sigma
Explorer

I'm looking to use the following as my timestamp.  What should I use in props as my timestamp format and timestamp prefix.
[20230718:001541.421] : [WARN ]

Labels (2)
Tags (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @the_sigma ,

if the timestamp it's at the beginning of the event, you could try:

TIME_PREFIX = ^\[
TIME_FORMAT = %Y%m%d:%H%M%S.%3N

If it isn't at the end of the event, please share some sample of your events, eventually masked, but with the same structure.

Ciao.

Giuseppe

 

0 Karma

the_sigma
Explorer

I tried your string in the datapreview screen.  I placed it in the timestamp format field.  I used \d{8}\:\d{6}\.\d{3} as the prefix put I'm still getting timestamp=none

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The prefix is the part that comes *before* the timestamp string and must not describe the timestamp string itself.  The prefix for the sample event would be ^[

---
If this reply helps you, Karma would be appreciated.
0 Karma

the_sigma
Explorer

I had already tried that as well but with no luck.  It has to be something else that I missing.  Thanks for replying though.   If I figure it out, I'll post an update here.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Assuming that represents 18 July 23 00:15:41.421 then the format string would be %Y%m%d:%H%M%S.%3N

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

From Alert to Resolution: How Splunk Observability Helps SREs Navigate Critical ...

It's 3:17 AM, and your phone buzzes with an urgent alert. Wire transfer processing times have spiked, and ...

ATTENTION!! We’re MOVING (not really)

Hey, all! In an effort to keep this Slack workspace secure and also to make our new members' experience easy, ...

Splunk Admins: Build a Smarter Stack with These Must-See .conf25 Sessions

  Whether you're running a complex Splunk deployment or just getting your bearings as a new admin, .conf25 ...