Dashboards & Visualizations

How to switch the dashboard after a regular interval in the app ?

Real_captain
Path Finder

Hi Team 

Is it possible to switch the dashboard after a regular interval in the same app ? 
I've around 15 dashboards in the same app and i want to switch to next dashboard after every 2 mins. 

Real_captain_0-1743604964762.png


In the above attached screenshot , i have around 15 dashboards and the home screen is always "ESES Hotline SUMMARY"  dashboard. 
Is it possible to move automatically to next dashboard "ESES Hotline" after 2 mins and then move automatically to next dashboard "EVIS Application" after 2 mins and so on. 

 

 

Labels (1)
0 Karma

PickleRick
SplunkTrust
SplunkTrust

While that is doable with JS code in simpleXML dashboard it's worth considering what's the goal here.

I mean each load of the dashboard (unless it uses a scheduled report to power the widgets) will execute searches. If their results aren't supposed to change you might - instead of go for rotating dashboards, create one bigger dashboard and use JS to toggle visibility of panels - this will give you the same result carouseling the panels but will not stress the server by spawning the same searches repeatedly.

0 Karma

tomapatan
Contributor

Good point! My refresh interval would have definitely been set to more than 10 seconds, so good call on that. Unfortunately, I spoke too soon—this solution won’t work as it refreshes the dashboard for all users, which isn’t the intended behaviour. I still need something similar to looping through browser tabs, but without requiring the installation of an extension.

0 Karma

tomapatan
Contributor

Hi,

This is what did the trick for me - save it as "dashboard-carousel.js"

(function() {
    // List of dashboard URLs to cycle through
    const urls = [
        "http://10.......",
        "http://10.......",
        "http://10......."
    ];

    // Time interval for cycling (in milliseconds)
    const interval = 10000; // 10 seconds

    // Get the current index from the URL query parameter (default to 0)
    const urlParams = new URLSearchParams(window.location.search);
    let currentIndex = parseInt(urlParams.get("index")) || 0;

    // Function to redirect to the next dashboard
    function cycleDashboards() {
        // Increment the index for the next cycle
        currentIndex = (currentIndex + 1) % urls.length;

        // Redirect to the next URL with the updated index as a query parameter
        window.location.href = `${urls[currentIndex]}?index=${currentIndex}`;
    }

    // Start the cycling process after the specified interval
    setTimeout(cycleDashboards, interval);
})();

Then reference it like this in your dashboard XML

<dashboard version="1.0" hideChrome="true"  script="dashboard-carousel.js">

0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

I don't think that you can do this with core splunk. But if you are using classic dashboards then maybe this is doable with javascript? And there is also react ui (see splunkui.splunk.com) which can help you with it? Maybe someone else who are more familiar with those and could help you?

Also this app maybe help you https://splunkbase.splunk.com/app/6859 ?

r. Ismo

0 Karma

livehybrid
SplunkTrust
SplunkTrust

Hi @Real_captain 

There isn't a built-in Splunk Web feature for this rotation. I would recommend using a browser extension such as "Tab Rotate" - these often have configurations like the amount of time and rate at which different tabs are rotated/reloaded.

Alternatively if you are using Classic dashboards you could write some custom javascript but I think you'll probably have better success, quicker, with an off-the-shelf browser extension.

 

🌟 Did this answer help you? If so, please consider:

  • Adding kudos to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...