Dashboards & Visualizations

Reload separate element within HTML dashboard

ateterine
Path Finder

Hi Splunk community,

I am working on a HTML dashboard for deeper customization of the data for displaying on large screens and unattended.
I have pretty good knowledge of CSS and HTML so customization works good so far.

I am trying to set dashboard to auto refresh without reloading the whole page (which is somewhat easy with either meta. tag or JavaScript.

But what I would rather have is to refresh each element (that way I can choose which elements I want to refresh and how often)

I've played with various methods, but cannot find a way to reload each element on a dashboard. I've tried Ajax's .load() function, but it doesn't load data when reloading the element.

Any help will be appreciated.

Thanks

1 Solution

martin_mueller
SplunkTrust
SplunkTrust

You can make a search run again by calling the SearchManager's startSearch() method, effectively reloading that panel.

View solution in original post

nfilippi_splunk
Splunk Employee
Splunk Employee

Splunk 6.1 now features element-specific refresh intervals.

In Simple XML, you can reference this as such:

<panel>
  <chart>
    <title>Enable auto refresh of 30s</title>
    <searchString>index=_internal | top limit=3 sourcetype</searchString>
    <earliestTime>-60m@m</earliestTime>
    <latestTime>now</latestTime>
    <option name="refresh.auto.interval">30</option>
  </chart>
</panel>

In HTML and JS, you can reference this as such:

var element2 = new ChartElement({
    "id": "element2",
    "resizable": true,
    "refresh.auto.interval": "30",
    "managerid": "search2",
    "el": $('#element2')
}, {tokens: true}).render();

ateterine
Path Finder

Thanks! Can't wait to upgrade to 6.1, very soon now 😉

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

You can make a search run again by calling the SearchManager's startSearch() method, effectively reloading that panel.

ateterine
Path Finder

Thanks! SavedSearchManager works the same way, I just had to create all elements by using:

var search1 = new SavedSearchManager ({...})
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...