Dashboards & Visualizations

Splunk Classic Dashboard - Prevent trigger of <change> on first load

dmoberg
Path Finder

In my dashboard, when one of the dropdowns are changed I need to reset the value in the other dropdowns to the default value (*); this can easily be done using the <change> function so no issues there. The problem arises when the user clicks a link to the dashboard with pre-populated parameters for the dropdowns (user is taken to a specific state of the dropdowns). The loading of the dashboard with the incoming HTTP parameters for the dropdowns also trigger the <change> to happen and thus resetting all of the selected dropdowns.

My questions is, how can I prevent the <change> to trigger on the Initial Load of the Dashboard? Once the Dashboard has been loaded I want the <change> to trigger when the user changes certain dropdowns.

I tried the following approach. In the dropdown for which I want to prevent the <change> to trigger a condition was added to check that the Token $FirstLoad$ is set to "Done".

<change>
<condition match="tostring($FirstLoad$) == &quot;Done&quot;">
<set token="form.PipelineName">*</set>
<set token="form.LabelName">*</set>
</condition>

In the heaviest Search I set a Token when completed (Done):
<done>
<set token="FirstLoad">Done</set>
</done>

 

The thinking for the above was that since on Initial Load the $FirstLoad$ Token will not initially be set which should prevent the <change> to trigger, but as soon as the $FirstLoad$ Token is updated to "Done", the <change> is triggered. Very frustrating.

Anyways, maybe I am missing something simple? Any ideas are appreciated.

Labels (1)
Tags (1)
0 Karma

dmoberg
Path Finder

I was able to solve it.

 

By populating the dropdowns in the Dashboard from an Inputlookup (with data from a scheduled search), it started working to use the approach I detailed below (setting the FirstLoad Token). Not sure exactly why this made it work but at least it works.

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @dmoberg ,

good for you, see next time!

let me know if I can help you more, or, please, accept one answer for the other people of Community.

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @dmoberg ,

see if this my old answer solves your requirement: https://community.splunk.com/t5/Dashboards-Visualizations/How-to-clear-reset-the-value-of-a-token/td...

Ciao.

Giuseppe

 

0 Karma

dmoberg
Path Finder

@gcusello, thanks but we need this to be automatically happening. It has to be some way to fix this?

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @dmoberg ,

for my knowledge, this is the only solution, no automatic.

Ciao.

Giuseppe

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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...