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!

Announcing Scheduled Export GA for Dashboard Studio

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

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...