Dashboards & Visualizations

How do I hide panel when "no results found" after selecting from drop-down list?

Neel88
Explorer

Hello,

I have multiple panels in same page. When I select any criteria from the dropdown, then I want to see only the panels which have the values. 

Labels (6)
0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @Neel88,

You can use below sample. You need to set different dependency token in each panel.

<dashboard>
  <label>test_hide</label>
  <row>
    <panel depends="$panel1$">
      <title>Panel 1</title>
      <event>
        <search>
          <query>index=_internal </query>
          <earliest>-5m@m</earliest>
          <latest>now</latest>
          <progress>
            <condition match="$job.resultCount$ == 0">
              <unset token="panel1"></unset>
            </condition>
            <condition>
              <set token="panel1">true</set>
            </condition>
          </progress>
        </search>
        <option name="list.drilldown">none</option>
      </event>
    </panel>
    <panel depends="$panel2$">
      <title>Panel 2</title>
      <event>
        <search>
          <query>index=_internal nothing to found </query>
          <earliest>-5m@m</earliest>
          <latest>now</latest>
          <progress>
            <condition match="$job.resultCount$ == 0">
              <unset token="panel2"></unset>
            </condition>
            <condition>
              <set token="panel2">true</set>
            </condition>
          </progress>
        </search>
        <option name="list.drilldown">none</option>
      </event>
    </panel>
  </row>
</dashboard>

 

If this reply helps you an upvote is appreciated.

Neel88
Explorer

Its working perfectly. Thank you so much for your help.

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 2 releases of new security content via the ...

Announcing the 1st Round Champion’s Tribute Winners of the Great Resilience Quest

We are happy to announce the 20 lucky questers who are selected to be the first round of Champion's Tribute ...

We’ve Got Education Validation!

Are you feeling it? All the career-boosting benefits of up-skilling with Splunk? It’s not just a feeling, it's ...