Dashboards & Visualizations

How to add custom time prompts "From Time" and "To Time" on a dashboard for panels to show data for chosen time ranges?

ronak
Path Finder

Setup

My setup has a dashboard that has static value of TODAY (meaning it is expected to show data only for TODAY).

Need

I want to add two prompts to the dashboard "From Time" & "To Time" (human readable format e.g. HH:MI), and want all panels on dashboard to consider TODAY+From Time , TODAY+To Time while searching

How can I achieve this functionality

thanks, ronak

0 Karma

tom_frotscher
Builder

Hi,

you can create a search for a complete day with the following earliest and latest filters:

index=_internal earliest=@d latest=@d+24h

What you can do then, is you can add or substract hours, minutes or seconds like this:

index=_internal earliest=@d+1h+10m latest=@d+24h-1h

So, if you have two textinputs and the inputs have tokens $from$ and $to$ you could create a search like:

index=_internal earliest=@d$from$ latest=@d+24h$to$

and all your users have to do, is type +14h and -6h to get the timerange from 14:00 to 18:00.

Greetings

Tom

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Enhance Security Operations with Automated Threat Analysis in the Splunk EcosystemAre you leveraging ...

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...