Splunk Search

How to write regex to extract 2014-09-11/06:00:01.708/EDT

gajananh999
Contributor

Dear All,

I stuck at silly thing i am not able to plot regular expression for 2014-09-11/06:00:01.708/EDT
My Regex is : ^\d{4}-\d{2}-\d{2}/\d{2}:\d{2}:\d{2}.\d{3}

But this is not working can anyone tell me where i an going wrong here.

Thanks

Tags (3)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

When importing your data, specify the timestamp string in strptime format. This one worked for me using your example:

%Y-%m-%d/%H:%M:%S.%3N/%Z
---
If this reply helps you, Karma would be appreciated.

srioux
Communicator

Per the note above, if you're using Data Preview, should use strptime formatting. Docs:
http://docs.splunk.com/Documentation/Splunk/6.1.3/Data/Modifyeventprocessing#Timestamps

0 Karma

gajananh999
Contributor

Hello MuS,

Its not working for me.
i am trying set Timestamp on Data Preview.

Thanks
Gajanan

0 Karma

MuS
SplunkTrust
SplunkTrust
0 Karma

gajananh999
Contributor

Hello Mus, I have tried without ^ bu no luck. its simple but i dont know where i am going wrong

0 Karma

MuS
SplunkTrust
SplunkTrust

This works on all those online regex testers .... try not to use any ^ or other special signs in the regex.

0 Karma

MuS
SplunkTrust
SplunkTrust

this works up til the timezone, if you need the TZ as well try this:

\d{4}-\d{2}-\d{2}/\d{2}:\d{2}:\d{2}.\d{3}\/\w+

MuS
SplunkTrust
SplunkTrust

or a bit more compact regex like this:

(\d{2,4}[\-\/\:\.])+\w+
0 Karma
Get Updates on the Splunk Community!

Your Guide to Splunk Digital Experience Monitoring

A flawless digital experience isn't just an advantage, it's key to customer loyalty and business success. But ...

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...