Splunk Search

Convert field representing time to another time format

cosullivan66
Explorer

Hi Everybody,

I have a field in my splunk events that is an XML field representing a videoconference session start time called ns2:sessionStartTime. An example of a field value is 2013-03-31T23:12:58.062-07:00. I want to turn this into a number (possibly Unix epoch time?) so I can perform ns2:sessionEndTime - ns2:sessionStartTime and figure out how long the session took. If there's any easier way of doing this calculation I'm all ears. Thanks for any and all help.

Conor

Tags (2)
0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

You're probably looking for this:

... | eval sessionStartTimeEpoch = strptime(sessionStartTime, "%FT%T.%3N%z")

View solution in original post

martin_mueller
SplunkTrust
SplunkTrust

You're probably looking for this:

... | eval sessionStartTimeEpoch = strptime(sessionStartTime, "%FT%T.%3N%z")

cosullivan66
Explorer

perfect, thank you so much!

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...