Splunk Search

Is it possible to set the _time field to have the value of another time field in my data?

ddrillic
Ultra Champion

We have the following -

logTime 2016-04-06 06:12:32,251 UTC
eventStartTime 2016-04-06 01:12:32.177
_time 2016-04-06T01:12:32.251-05:00

Is it possible to set the _time field to have the value of eventStartTime?

Tags (2)
0 Karma
1 Solution

lguinn2
Legend

If eventStartTime appears in the data, you can use props.conf to use that field as the timestamp at parsing time.
Check out the documentation: Configure timestamp recognition

View solution in original post

lguinn2
Legend

If eventStartTime appears in the data, you can use props.conf to use that field as the timestamp at parsing time.
Check out the documentation: Configure timestamp recognition

somesoni2
SplunkTrust
SplunkTrust

Please note that this is index-time configuration/activity and will only be applicable for any future data that you ingest after you make the changes. Already existing data would not get affected.

0 Karma

ddrillic
Ultra Champion

Perfect. Is there a way, by any chance, to do it on the fly, meaning at search time?

0 Karma

somesoni2
SplunkTrust
SplunkTrust

You can change the _time to have values from field eventStartTime , at search time like this, but note that the time range will still apply from the older value of _time.

your base search | eval _time=strptime(eventStartTime,"%Y-%m-%d %H:%M:%S.%N")

thdose
New Member

Is there no way to have the timepicker (including ranges) work when assigning _time to custom a field?

0 Karma

ddrillic
Ultra Champion

Gorgeous !!!!

0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...