Dashboards & Visualizations

Showing and hiding panel on value click

martynjlewis
Engager

Hi all

I am trying to create a hidden panel that shows when a value from a table is clicked but then stop showing when clicked again. I've added the existing test XML here. Could someone please help?

Thanks

 

<dashboard version="1">
  <label>DrillDown</label>
  <row>
    <panel>
      <table>
        <search>
          <query>index=_*|stats count by sourcetype</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </search>
        <drilldown>
          <set token="tok_sourcetype">$click.value$</set>
          <set token="show_panel">true</set>
        </drilldown>
      </table>
    </panel>
  </row>
  <row>
    <panel depends="$show_panel$">
      <chart>
        <search>
          <query>index=_* sourcetype=$tok_sourcetype$|timechart count</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </search>
        <option name="charting.chart">line</option>
        <option name="charting.drilldown">all</option>
        <drilldown>
          <unset token="show_panel"></unset>
        </drilldown>
      </chart>
    </panel>
  </row>
</dashboard>
Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
<dashboard version="1">
  <label>DrillDown</label>
  <row>
    <panel>
      <table>
        <search>
          <query>index=_*|stats count by sourcetype</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </search>
        <drilldown>
          <set token="tok_sourcetype">$click.value$</set>
          <eval token="show_panel">if($show_panel$="true",null(),"true")</eval>
        </drilldown>
      </table>
    </panel>
  </row>
  <row>
    <panel depends="$show_panel$">
      <chart>
        <search>
          <query>index=_* sourcetype=$tok_sourcetype$|timechart count</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </search>
        <option name="charting.chart">line</option>
        <option name="charting.drilldown">all</option>
      </chart>
    </panel>
  </row>
</dashboard>

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
<dashboard version="1">
  <label>DrillDown</label>
  <row>
    <panel>
      <table>
        <search>
          <query>index=_*|stats count by sourcetype</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </search>
        <drilldown>
          <set token="tok_sourcetype">$click.value$</set>
          <eval token="show_panel">if($show_panel$="true",null(),"true")</eval>
        </drilldown>
      </table>
    </panel>
  </row>
  <row>
    <panel depends="$show_panel$">
      <chart>
        <search>
          <query>index=_* sourcetype=$tok_sourcetype$|timechart count</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </search>
        <option name="charting.chart">line</option>
        <option name="charting.drilldown">all</option>
      </chart>
    </panel>
  </row>
</dashboard>

livehybrid
SplunkTrust
SplunkTrust

Hi @martynjlewis 

Just to clarify, what is it that you would click the second time in order to hide the panel?

You could have a "Reset" button or something at the top which could unset the token?

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

0 Karma
Get Updates on the Splunk Community!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...