All Apps and Add-ons

Splunk Web Framework Toolkit: Can you synchronize many searches in a dashboard?

gmercier
Explorer

Hello,

For front purposes (I'm building a dashboard using the JS framework), I want to synchronize all my searches so that they start at the same time.

But the refresh countdown seems to start when a search GET the results, so if it takes longer, it is delayed from the other searches of the dashboard (which have the same refresh time though).

=> Do you know if there is a simple way to make searches start at the very same time (I don't care if they get results at different time) ? Or do I have to use JS timers ?

Thanks for your help 🙂

Guillaume

0 Karma
1 Solution

jeffland
SplunkTrust
SplunkTrust

Just to clarify, you want all searches on your dashboard to refresh at the same time? How are you restarting them at the moment, does each panel have a refresh? You may want to change the refresh type of your panels from delay to interval then. That changes the refresh timer from its default method which waits the given time after the search is done to the method that waits the given time from when the search is dispatched.
Alternatively, you could remove the panel-based refresh entirely and make your entire dashboard refresh like this:

<dashboard refresh="30">
  <label>Dashboard title</label>
  ...

The docs for this topic are here, search for occurences of refresh.

View solution in original post

jeffland
SplunkTrust
SplunkTrust

Just to clarify, you want all searches on your dashboard to refresh at the same time? How are you restarting them at the moment, does each panel have a refresh? You may want to change the refresh type of your panels from delay to interval then. That changes the refresh timer from its default method which waits the given time after the search is done to the method that waits the given time from when the search is dispatched.
Alternatively, you could remove the panel-based refresh entirely and make your entire dashboard refresh like this:

<dashboard refresh="30">
  <label>Dashboard title</label>
  ...

The docs for this topic are here, search for occurences of refresh.

gmercier
Explorer

Hello,

And thanks for you reply ! You got it, I'm going to use interval instead of delay.

Thanks a lot, I was lost in the doc and you've saved me 🙂

0 Karma

jeffland
SplunkTrust
SplunkTrust

You're welcome. The Simple XML reference is indeed a massive document, if you don't know what to look for it's easy to get lost there.

0 Karma

gmercier
Explorer

It is, but what I didn't mention is that I'm using the Search Manager from the JS framework !

So I didn't thought to check the XML properties first, and thanks to you I realized that almost the same properties are included in the SearchManager (by looking in the JS attributes of the search), but are not in the documentation.

But it seems that it's not working, even with the refreshtype : interval, my searches are still triggering the refresh time when they are done... Maybe it is not implemented yet ?

Thanks for your help ! 🙂

0 Karma

jeffland
SplunkTrust
SplunkTrust

The documentation for the js framework is... shorter than the Simple XML reference. If you're in js, why don't you leave the searches as non-refreshing searches and restart them from a for-loop? Seems simpler than finding something that may work or not and may or may not be documented somewhere.

0 Karma

gmercier
Explorer

It is, definitely 😄

Yes, it's a great idea, but I wanted to check first if there wasn' t a "best practice" way to do it, in order to produce a code more maintainable, in vain apparently !

Thanks, I'm going to do this, as I'm already branched to the "search:done" events of all my searches 🙂

Thanks a lot, Jeff, you have been a big help 🙂

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...