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
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...