Splunk Search

Is there a way to change the time duration calculated to a more readable format?

splunkin11
Path Finder

Is there a way to change the time duration calculated to a more readable format?

Trying to go from something like this : "40+09:01:43" to something more like "40 days + 09:01:43"

0 Karma
1 Solution

sundareshr
Legend

This will work even if duration is less than 1 day.

.... | rex field=duration "((?<d>\d+)\+)?(?<t>.*)" | fillnull days value=0 | eval duration=d." days + ".t

View solution in original post

sundareshr
Legend

This will work even if duration is less than 1 day.

.... | rex field=duration "((?<d>\d+)\+)?(?<t>.*)" | fillnull days value=0 | eval duration=d." days + ".t

splunkin11
Path Finder

Excellent! Thank you.

0 Karma

gokadroid
Motivator

if say this data is in field myDate then how about using this below:

query to return myDate
| rex field=myDate "(?<days>[^\+]+)\+(?<myTime>.*)"
| eval completeTime=days." days + ".myTime
| tabe myDate, completeTime

See here the extraction

Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...