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
Revered Legend

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
Revered Legend

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!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...