Dashboards & Visualizations

Change default time range based on current time

jlew715
Loves-to-Learn Lots

Hey all,

I need to have the default time range for a dashboard cover an overnight shift. This necessitates the time range change depending upon when the page is loaded:

Time user loads pageTime  rangeDescription
00:00 - 17:59@d-1d+18h  to  @d+618:00 yesterday to 06:00 today
18:00 - 23:59@d+18h  to  @d+1d+6h18:00 today to 06:00 tomorrow

 

After a few hours of searching the forums I haven't seen another example where this is done, and I can't for the life of me figure out how to do it. Any help or just a nudge in the right direction would be appreciated!

 

Thanks,

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

-1d@d+18h to @d+6h

@d+18h  to  +1d@d+6h

0 Karma

jlew715
Loves-to-Learn Lots

Ok, I can confirm those are the two ranges I need.

How / where do I specify those as the default? Where do I put the logic to say "IF the local time is after 18:00 but before 23:59, use @d+18h  to  +1d@d+6h ELSE IF the local time is after 00:00 but before 17:59, use  -1d@d+18h to @d+6h"?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Will this work

Earliest = +6h@d-6h

Latest = +6h@d+6h

0 Karma
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!

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...

Index This | How many sevens are there between 1 and 100?

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