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.
@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
.
@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
.
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
Searches can also take depends token like the panels or rows.
search id="search1" depends="$checkbox$"
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.
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.