Splunk Search

convert large duration timelapse to decimal hour

mjones414
Contributor

I'm trying to convert a timestamp where my hour will go beyone 24 hours: for example: 305:44:03 The ctime and dur2sec don't seem to be handling this timeformat properly with either "%H:%M:%S or %H%H%H:%M:%S or %k:%M:%S. and so on...

Tags (1)
0 Karma

chrisyounger
SplunkTrust
SplunkTrust

Well you could carve it up yourself like this:

| makeresults 
| eval val ="305:44:03" 
| rex field=val "(?<hr>\d+):(?<min>\d+):(?<sec>\d+)" 
| eval duration = (hr * 3600) + (min * 60) + sec 
| table duration

All the best

0 Karma
Get Updates on the Splunk Community!

Take the 2021 Splunk Career Survey for $50 in Amazon Cash

Help us learn about how Splunk has impacted your career by taking the 2021 Splunk Career Survey. Last year’s ...

Using Machine Learning for Hunting Security Threats

WATCH NOW Seeing the exponential hike in global cyber threat spectrum, organizations are now striving more for ...

Observability Newsletter Highlights | March 2023

 March 2023 | Check out the latest and greatestSplunk APM's New Tag Filter ExperienceSplunk APM has updated ...