Dashboards & Visualizations

How to only show drilldown panels on matching dropdown page?

michaeler
Path Finder

My dashboard has about 45 panels split between 8 pages using a dropdown. I am adding drilldowns that open panels that are hidden until a user clicks on a chart or table. My issue is that when I'm on a certain page and click on a visualization and the hidden panel appears, it remains displayed when I switch to a different page.

I can't copy and paste my code so here's a snippet of what I have:

<form>
  <label>My Dashboard</label>
  <fieldset submitButton="false">
    <input type="dropdown" token="type" searchWhenChanged="true">
      <label>Select Page</label>
      <choice value="A">A</choice>
      .......same for B-G.......
      <choice value="H">H</choice>
      <change>
        <condition value="A">
          <set token="A_panel">true</set>
          <unset token="B_panel"></unset>
           ......unset C-H......
        </condition>
        <condition value="B">
          <set token="B">true</set>
          <unset token="A_panel"></unset>
          ......unset C-H......
        </condition>
        <condition>
          .....Repeat for C-H.....
        </condition>
      </change>
    </input>
  </fieldset>
  <row>
    <panel depends="$A_panel$">
      <title>Panel A1</title>
      <table>
        <search>
          <query>| index=* App=* Status="Down" | table App A B C </query>
          <earliest>0</earliest>
          <latest></latest>
        </search>
        <option name="drilldown">cell</option>
        <drilldown>
          <set token="show_panel_A1">true</set>
          <set token="selected_app">$click.value$</set>
          <eval token="drilldown.earliest">case($click.name2$=="30 Days", "-30d", $click.name2$=="60 Days", "-60d")
          <eval token="drilldown.latest">case($click.name2$=="30 Days", "now", $click.name2$=="60 Days", "-30d")
        <drilldown>
      </table>
    </panel>
  </row>
  <row>
    <panel depends="$show_panel_A1$">
      <title>Count for $selected_app$</title>
      <chart>
        <search>
          <query>| index=* App=* Status="Down" earliest=$drilldown.earliest$ latest=$drilldown.latest$ | search App="$selected_app$" | timechart count by App </query>
        </search>
      </chart>
    </panel>
  </row>

I've tried adding the <unset token> for other drilldown panels under <drilldown> and <condition value=""> sections but the panels don't hide again after I select a different drilldown or move pages.

Labels (5)
Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Try putting the depends on the rows

  <row depends="$A_panel$">
    <panel>

  <row depends="$A_panel$">
    <panel depends="$show_panel_A1$">

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

Try putting the depends on the rows

  <row depends="$A_panel$">
    <panel>

  <row depends="$A_panel$">
    <panel depends="$show_panel_A1$">

michaeler
Path Finder

I was certain I tried this already and received an error about redefining 'depends' but I tried it again anyways it it worked! 

I'm glad the answer is simple and easy to implement but disappointed I didn't try this already...

0 Karma
Get Updates on the Splunk Community!

Build Scalable Security While Moving to Cloud - Guide From Clayton Homes

 Clayton Homes faced the increased challenge of strengthening their security posture as they went through ...

Mission Control | Explore the latest release of Splunk Mission Control (2.3)

We’re happy to announce the release of Mission Control 2.3 which includes several new and exciting features ...

Cloud Platform | Migrating your Splunk Cloud deployment to Python 3.7

Python 2.7, the last release of Python 2, reached End of Life back on January 1, 2020. As part of our larger ...