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!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...