Dashboards & Visualizations

How to load some panels only when everything is loaded or load them only when a checkbox is selected.

macadminrohit
Contributor

I have three searches (tables) which show on the dashboard only when i select a check box on the top . But in the background they have already loaded. I do not want that, because that behaviour slows other panels. I only want those searches to run when the check box is selected.

Tags (1)
0 Karma
1 Solution

niketn
Legend

@macadminrohit, refer to Section 5 of this blog from Luke Murphy https://www.splunk.com/blog/2015/03/30/making-a-dashboard-with-tabs-and-searches-that-run-when-click...

You can add the checkbox token to your search to prevent the search from running when the token is not set.

One other example on similar lines would be something like the following:

<yourBaseSearch>
| <yourRemainingSearchWithStats>
| eval dummy="$<yourCheckBoxToken>$"
| fields - dummy

This does not show the field dummy in your search but adds a dependency with the token required to run the search. Hence if the Check Box is not checked your Search will keep waiting for input.

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

View solution in original post

0 Karma

niketn
Legend

@macadminrohit, refer to Section 5 of this blog from Luke Murphy https://www.splunk.com/blog/2015/03/30/making-a-dashboard-with-tabs-and-searches-that-run-when-click...

You can add the checkbox token to your search to prevent the search from running when the token is not set.

One other example on similar lines would be something like the following:

<yourBaseSearch>
| <yourRemainingSearchWithStats>
| eval dummy="$<yourCheckBoxToken>$"
| fields - dummy

This does not show the field dummy in your search but adds a dependency with the token required to run the search. Hence if the Check Box is not checked your Search will keep waiting for input.

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

renjith_nair
SplunkTrust
SplunkTrust

Hi @macadminrohit ,

If you want your searches run only after checkbox is selected, then you need to set a token on checkbox set and use it in your search so that the search will not run until that token is set.

For e.g. index=abc "other search terms" $hereismytokenfromcheckbox$

The token could be set to something which is always true so that your searches will be run as soon as the token is set

Happy Splunking!
0 Karma

kyaparla
Path Finder

Searches can also take depends token like the panels or rows.

search id="search1" depends="$checkbox$"

0 Karma

macadminrohit
Contributor

I have already done that but it still loads that in the background. I just don't want to load it unless I click on that check box. Here loading means , I don't even want that search to run before clicking the checkbox.

0 Karma

kyaparla
Path Finder

checkbox is little different, even when its not selected the token is value is still set to something. Token should be unset for this to work. Do unset of token during init of dashboard and test it.

0 Karma
Get Updates on the Splunk Community!

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 ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...