Splunk Search

How to extract time format using rex? "TransactionStartTime=12/19/2017 06:23:35.474"

karthi2809
Builder

How to extract time format using rex ?

TransactionStartTime=12/19/2017 06:23:35.474;

0 Karma
1 Solution

mayurr98
Super Champion

if you to extract this as your event time then put below in props.conf

[your_sourcetype]
TIME_PREFIX = TransactionStartTime=
TIME_FORMAT = %m/%d/%y %H:%M:%S.%3N

If you want to extract it in a field called "TransactionStartTime"

index=your_index | rex field=_raw "TransactionStartTime=(?P<TransactionStartTime>\d{2}\/\d{2}\/\d{4}\s\d{2}:\d{2}:\d{2}\.\d{3})"

Let me know if this helps!

View solution in original post

mayurr98
Super Champion

if you to extract this as your event time then put below in props.conf

[your_sourcetype]
TIME_PREFIX = TransactionStartTime=
TIME_FORMAT = %m/%d/%y %H:%M:%S.%3N

If you want to extract it in a field called "TransactionStartTime"

index=your_index | rex field=_raw "TransactionStartTime=(?P<TransactionStartTime>\d{2}\/\d{2}\/\d{4}\s\d{2}:\d{2}:\d{2}\.\d{3})"

Let me know if this helps!

karthi2809
Builder

Thanks you mayurr98

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 ...