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.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...