Splunk Search

I want to find the difference between the below 2 times in hh:mm:ss format, can somebody please assist? 03/17/2016 11:45:05 2016-03-17 11:44:03.0

ppanchal
Path Finder

I want to find the difference between the below 2 times in hh:mm:ss format, can somebody please assist?

03/17/2016 11:45:05 2016-03-17 11:44:03.0

Tags (2)
0 Karma

lguinn2
Legend

Easy. Assume that the two strings are in fields timeEarlier and timeLater

yoursearchhere...
| eval timeDiff = strptime(timeLater,"%x %X") - strptime(timeEarlier,"%x %X")
| eval timeDiff_formatted = tostring(timeDiff,"duration")
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...