All Apps and Add-ons

How to prevent tabs from refreshing searches on click?

dorlevy88
Engager

Using sideview editor, I'm trying to create a dashboard that will have tabs (Data & Hardware) where the searches will not be refreshed every time a different tab is being clicked.

I tried the following schemes in order to do it, but none worked -


1. tabs -> switcher -> search (Data) -> JSChart
-> search (Hardware) -> JSChart
Every time a tab is being clicked, the search is being launched again
2. tabs -> switcher -> gater (to:Gater_Hardware)
-> gater (to:Gater_Data)
search (Hardware) -> gater (Gater_Hardware) -> JSCahrt
search (Data) -> gater (Gater_Data) -> JSCahrt
Here the problem is that the push doesn't come from the search so the JSChart has no data

Thanks for the help,
Dor Levy

0 Karma

sideview
SplunkTrust
SplunkTrust

When the user clicks on a tab, that causes a push to all the modules downstream of the Tabs module. If there is a Search module there in the active tab, and if that Search module has dispatching modules (Table/JSChart/etc) downstream from it, then the framework will dispatch a search. There's no way around this.

However...

1) To the extent that the data from the two tabs can be combined into a single search result, and then selectively queried via different PostProcess modules, one in each tab, then you can sort of cheat.

More precisely -- you pull the Search module up above the Tabs entirely, you make sure there's some dispatching module in the right place, like a JobProgressIndicator that is a sibling of the Tabs module (ie neither downstream nor upstream but at the same level). Then you get the right bits of the data going to the right Tab with 2 PostProcess modules.

2) As ppablo_splunk mentioned, there's another post where the solution was to use a Button module with allowSoftSubmit false. http://answers.splunk.com/answers/142870/tabs-module-tab-switcher-and-timeselector With allowAutoSubmit True and allowSoftSubmit False, the Button would effectively shield the searches from being dispatched when the tab is clicked. (You would typically put "Run Again" or something as the label on the Buttons.)

As to trying to use the Gate module for this kind of solution... Gate can do a lot of weird things, but subverting the basic push/dispatch behavior of the framework is a tall order. And even if you could sort of stash jobs somewhere on the page and then render them to each tab with Gate module pushes, I think you might end up also disrupting the show/hide behavior of the Tabs module.

ppablo
Retired

Hi @dorlevy88

This Answers post has a similar issue and has a solution that may be what you're looking for.

http://answers.splunk.com/answers/142870/tabs-module-tab-switcher-and-timeselector

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

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...