Dashboards & Visualizations

How to auto-refresh the dashboard using splunk application?

gokikrishnan198
New Member

I need an option to auto-refresh the dashboard using the application than doing it in scripts. If I need to do it in scripts, I need to modify each and every query I search in. Do I have an option to include the auto-refresh command in the query itself? This will help us in the real-time monitoring? I tried with the previously asked questions, which gave answers only to the scripts but not the application. Request you to update asap.

0 Karma

gokikrishnan198
New Member

Thanks for the clarification provided. I made the modification in the dashboard form which worked. Further to add in this question, I mentioned like real-time monitoring which means refreshing the screen at every equal interval. Do we need mention the time range picker even during real-time monitoring? Can't we skip it?

0 Karma

gokikrishnan198
New Member

@niketnilay,
Do you want to apply Refresh on dashboard level or script level?
I would like to have the refresh at the dashboard level.

Is the refresh Interval supposed to be same or different for different dashboards?
Yes, I would like to change the refresh rate for the dashboard. It can be the same dashboard or different.

Within a single dashboard can the refresh interval be different?
No, I am not asking for the refresh of the different panels in the same dashboard.

Do you want to refresh Dashboard/Panel/s on demand or set some interval like every 5 min?
I would like to have the refresh of Dashboard on demand. Example: Chrome Extension, Easy Auto-Refresh.

What is the window of Real-Time interval you need? Or are you planning real-time searches on your dashboard?
Not real-time searches. If the dashboard refreshes automatically that might look like a real-time view of the dashboard.

0 Karma

niketn
Legend

I would like to change the refresh rate for the dashboard and I would like to have the refresh of Dashboard on demand seem contradictory. The reason for those two questions was?

1) Either you can have an interval for Dashboard Refresh like 10 min by default which you can change through Simple XML. Refer to @martin_mueller 's answer below for <refresh> option in Simple XML for this.

Following is one of my older answers for making Dashboard refresh configurable. You can store the refresh time in lookup file/KV Store and then access the same in Simple XML through SPL and pass on to a token to set the interval in JS (Following example has static time but the same can be extended as per your need. Let me know if you need help with this approach). https://answers.splunk.com/answers/550114/how-to-make-form-refresh-value-configurable.html

2) Or you can have a button in Dashboard which would Refresh the moment your click (i.e. Adhoc or On Demand). This option requires JS but I am not sure what you would need to change in each and every query I search in as per your question. You can add a HTML button in your Dashboard for refresh and use JavaScript to refresh you dashboard. Refer to the following example: https://answers.splunk.com/answers/554639/i-want-to-refresh-the-dashboard-on-button-click-is.html

If this is the approach you want and your expectation is not what this code does please elaborate.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

niketn
Legend

@gokikrishnan1982, I think you have posted your previous comment the answer I listed only for your reference. Also, requesting you to post a comment as opposed to Answer.

After looking at a Easy Auto Refresh behavior, seems like you are looking for an option to have dashboard refreshed on a regular interval, which can be done via refresh attribute i.e. <form refresh="300"> or <dashboard refresh="300"> which sets refresh time to 300 seconds or 5 minute. Refer to documentation below:

http://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML#dashboard_or_f...
This was already outlined by @martine_mueller in his answer below.

If you want this setting as configurable setting in the UI, you would need to code using JavaScript. Which is not a workaround as depending on coding level Simple XML JS Extension, HTML Dashboards and Splunk JS stack are all Splunk App Development mechanisms. Please let us know if you would need a help with this. Once you built this you would need to refer to your JavaScript (and optional Pre-built Panel) to show the options to change default refresh interval of dashboards.

From UI Edit option perspective, Splunk gives you an option to set the Refresh Interval of individual Panels in the Dashboard by Refreshing <search> using <refresh> attribute (in edit mode). (If you establish a dependency between base search and all remaining searches, you can set this once and it will do a cascaded refresh or other searches as well). Through tokens this option can be converted to Dropdown/Radio based option similar to the Easy Auto Refresh app that you have referred. Refer to documentation: http://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML#search

Depending on your code skill level you can apply either Simple XML, or Simple XML JS Extension or Simple XML JS Extension with Splunk JS Stack or Splunk Web Framework with complete control of your HTML/Splunk JS and CSS.

If none of these cater to your needs and you need Splunk UI to support dashboard/form <refresh>, you would need to request an enhancement in Splunk by reaching out to Splunk Support with your Splunk Entitlement.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

niketn
Legend

@gokikrishnan1982 what do you mean by ...each and every query I search in? Do you want to apply Refresh on dashboard level or script level? Is the refresh Interval supposed to be same or different for different dashboards? Within a single dashboard can the refresh interval be different?

Do you want to refresh Dashboard/Panel/s on demand or set some interval like every 5 min? What is the window of Real-Time interval you need? Or are you planning real-time searches in your dashboard?

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...