Dashboards & Visualizations

Visualization hide/unhide using depend for token set in multiselect

stanwin
Contributor

The below selection logic does NOT work when i want to display the charts when ONLY ALL is selected in the 'select the area' token.

Am using set token with depends to display certain set of panels.

Any idea what i am doing wrong please?

    <input type="multiselect" token="search_terms">
          <label>Select the area</label>
           <choice value="*">ALL</choice>
           <choice value="CreateCust">CreateCust</choice>
           <choice value="updt">updt Cust</choice>
           <choice value="join scam">join schem</choice>
           <choice value="leave Scam">leave schem</choice>
          <change>
            <condition label="ALL">
              <set token="hidden_panel">SHOW</set>
            </condition>
          </change>
        </input>
      </fieldset>

    <!-- This chart will always show ONLY if ALL is selected -->
        <chart depends="$hidden_panel$">
          <title>trend Customer</title>
          <search>
    </chart> 
    <!-- This chart will always display -->
<chart >
          <title>trend Customer</title>
          <search>
    </chart> 
     <!-- This chart will always show ONLY if ALL is selected -->
    <chart depends="$hidden_panel$">
          <title>trend Customer</title>
          <search>
    </chart> 
Tags (2)
0 Karma

rjthibod
Champion

The issue is multiselect inputs don't support the change element. See reference here: http://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML#change.

You would have to use JavaScript to handle setting and unsetting the token or add an extra background search that can determine if ALL is set or not. The latter will work without JS but it is not super-clean.

0 Karma

cmerriman
Super Champion

ahh, that would do it. normally when i do this, I use checkbox. I'd never tried it on multiselect.

0 Karma

stanwin
Contributor

well i took the alternative way out & shifted that logic to a radio button.

I will try to work it out with checkbox just for closure to this answer.

0 Karma

cmerriman
Super Champion

the problem is because you're setting a token that doesn't exist. if you have <set token="search_termsl">SHOW</set>, then it works, however, it will populate for all selections, which isn't what you want. you will need to try to eval a token with the correct conditions <eval token="hidden_panel">$search_terms$=*</eval> possibly

0 Karma

stanwin
Contributor

Thanks for the reply!

Doesn't seem to work it shows the hidden panel always.

I am trying various combinations .

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...