Dashboards & Visualizations

Best Way to Implement Logic in Dashboard Timeframe?

npapa
Explorer

Hello,
I have a dashboard built for a team that will be monitoring events from 6pm to 6am every day. Each panel refreshes every 10 minutes. We are running Splunk 6.5.3. Currently the timeframe set for the dashboard that the panels reference is

<input type="time" token="field1">
    <label></label>
    <default>
        <earliest>@d-6h</earliest>
        <latest>@d+6h</latest>
    </default>
</input>

This only shows what we want starting at midnight. For example: If I checked the dashboard at 3am on Tuesday I will see events starting at 6pm Monday up until 3am Tuesday which is good. But if I were to check the dashboard at 9pm Monday, I will instead see events from 6pm Sunday to 6am Monday.

Ideally I'd like to implement logic so that the dashboard "resets" at 6pm daily, and runs until 6am the next morning and have that repeat every evening. I could be overthinking this so I am open to any suggestions. Thank you!

0 Karma
1 Solution

aholzer
Motivator

I think what you want is:

earliest=+6h@d-6h
latest=+6h@d+6h

Logic:
If it's before 6pm adding 6 hours will still result it in being the same day, so applying @d will truncate to start of day, and then the -6h or +6h will set it correctly
If it's 6pm or later adding 6 hours will result in the day increasing by one, so when you apply the @d it will truncate to start of next day causing the "reset" you are looking for

Hope this helps

View solution in original post

aholzer
Motivator

I think what you want is:

earliest=+6h@d-6h
latest=+6h@d+6h

Logic:
If it's before 6pm adding 6 hours will still result it in being the same day, so applying @d will truncate to start of day, and then the -6h or +6h will set it correctly
If it's 6pm or later adding 6 hours will result in the day increasing by one, so when you apply the @d it will truncate to start of next day causing the "reset" you are looking for

Hope this helps

npapa
Explorer

Thanks! This seems to be what I was trying to accomplish.

0 Karma
Get Updates on the Splunk Community!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...