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!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...