Splunk Enterprise

How to to capture the below time stamp using "Time_Prefix's Regex."?

super_saiyan
Communicator

I want to capture the below time stamp using "Time_Prefix's Regex."

20220207T111737.014+0800

There is no guarantee that version will always be in that format, so  can someone please help me with a generic Regex ? 

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Regex is pattern matching - a generic pattern is neither possible nor useful - for example, ".*" will match to any time stamp you have, but it will also match to everything else which isn't a time stamp. In order to be useful, you will need to identify all the formats you consider to be time stamps in your events, and determine a common pattern or patterns (as few as possible) which describes the time stamp.

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Regex is pattern matching - a generic pattern is neither possible nor useful - for example, ".*" will match to any time stamp you have, but it will also match to everything else which isn't a time stamp. In order to be useful, you will need to identify all the formats you consider to be time stamps in your events, and determine a common pattern or patterns (as few as possible) which describes the time stamp.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...