Dashboards & Visualizations

Panel Hide

Als123
Explorer

Hi Team,

I am having 5 panels in my dashboard and having two drop downs. 

First drop down: A, B and C

Second From down : Depends on first drop down values will populate in second drop down. Example : A1, B1 and C1.

Now If i am selecting A or B, I need to get only 4 panels in my dashboard. But If I am selecting C then I need to get all the 5 panels in my dashboard. 

Can you please help me on this?

Labels (1)
0 Karma
1 Solution

kamlesh_vaghela
SplunkTrust
SplunkTrust

@Als123 

Are you looking for this?

<form>
  <label>Dropdown</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="firstDropDown">
      <label>firstDropDown</label>
      <choice value="A">A</choice>
      <choice value="B">B</choice>
      <choice value="C">C</choice>
      <change>
        <condition match="'value'==&quot;A&quot; or 'value'==&quot;B&quot;">
          <set token="tkn_a_or_b">true</set>
          <unset token="tkn_c"></unset>
        </condition>
        <condition match="'value'==&quot;C&quot;">
          <set token="tkn_c">true</set>
          <set token="tkn_a_or_b">true</set>
        </condition>
        <condition>
          <unset token="tkn_c"></unset>
          <unset token="tkn_a_or_b"></unset>
        </condition>
      </change>
    </input>
  </fieldset>
  <row>
    <panel depends="$tkn_a_or_b$">
      <single>
        <title>Panel 1</title>
        <search>
          <query>| makeresults | stats count</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </single>
    </panel>
    <panel depends="$tkn_a_or_b$">
      <single>
        <title>Panel 2</title>
        <search>
          <query>| makeresults | stats count</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </single>
    </panel>
    <panel depends="$tkn_a_or_b$">
      <single>
        <title>Panel 3</title>
        <search>
          <query>| makeresults | stats count</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </single>
    </panel>
    <panel depends="$tkn_a_or_b$">
      <single>
        <title>Panel 4</title>
        <search>
          <query>| makeresults | stats count</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </single>
    </panel>
    <panel depends="$tkn_c$">
      <single>
        <title>Panel 5</title>
        <search>
          <query>| makeresults | stats count</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </single>
    </panel>
  </row>
</form>

 

Thanks
KV
▄︻̷̿┻̿═━一

If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.

View solution in original post

kamlesh_vaghela
SplunkTrust
SplunkTrust

@Als123 

Are you looking for this?

<form>
  <label>Dropdown</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="firstDropDown">
      <label>firstDropDown</label>
      <choice value="A">A</choice>
      <choice value="B">B</choice>
      <choice value="C">C</choice>
      <change>
        <condition match="'value'==&quot;A&quot; or 'value'==&quot;B&quot;">
          <set token="tkn_a_or_b">true</set>
          <unset token="tkn_c"></unset>
        </condition>
        <condition match="'value'==&quot;C&quot;">
          <set token="tkn_c">true</set>
          <set token="tkn_a_or_b">true</set>
        </condition>
        <condition>
          <unset token="tkn_c"></unset>
          <unset token="tkn_a_or_b"></unset>
        </condition>
      </change>
    </input>
  </fieldset>
  <row>
    <panel depends="$tkn_a_or_b$">
      <single>
        <title>Panel 1</title>
        <search>
          <query>| makeresults | stats count</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </single>
    </panel>
    <panel depends="$tkn_a_or_b$">
      <single>
        <title>Panel 2</title>
        <search>
          <query>| makeresults | stats count</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </single>
    </panel>
    <panel depends="$tkn_a_or_b$">
      <single>
        <title>Panel 3</title>
        <search>
          <query>| makeresults | stats count</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </single>
    </panel>
    <panel depends="$tkn_a_or_b$">
      <single>
        <title>Panel 4</title>
        <search>
          <query>| makeresults | stats count</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </single>
    </panel>
    <panel depends="$tkn_c$">
      <single>
        <title>Panel 5</title>
        <search>
          <query>| makeresults | stats count</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </single>
    </panel>
  </row>
</form>

 

Thanks
KV
▄︻̷̿┻̿═━一

If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.

ITWhisperer
SplunkTrust
SplunkTrust

Please share your SimpleXML for your dropdowns i.e. how are you setting the tokens used for hiding and showing the panels.

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...