Splunk Search

Show the time range of a search in HH:MM in a table

chadman
Path Finder

I would like to show the HH:MM of my search as a field in a table. How can I set that up as a field?

Tags (2)
1 Solution

sundareshr
Legend

Like this

your base search | eval time=strftime(_time, "%H:%M") | table _time time 

*UPDATED based on comment*

your base search | addinfo | eval duration=info_max_time-info_min_time | eval dur_formatted=tostring(duration, "duration") | table dur*

View solution in original post

0 Karma

sundareshr
Legend

Like this

your base search | eval time=strftime(_time, "%H:%M") | table _time time 

*UPDATED based on comment*

your base search | addinfo | eval duration=info_max_time-info_min_time | eval dur_formatted=tostring(duration, "duration") | table dur*
0 Karma

chadman
Path Finder

Perfect! That worked great!

0 Karma

chadman
Path Finder

actually displaying this in seconds would work better.

0 Karma

sundareshr
Legend

So you want to display the duration of the search? Are you displaying it in a dashboard?

0 Karma

chadman
Path Finder

So if I do a search from 8AM to 9AM I would like to see the difference in seconds, 3600

0 Karma

sundareshr
Legend

Aha.. see updated answer below..

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...