Splunk Search

How do I hide a panel in my dashboard that is displaying "no results found" and that is being populated by a base search?

adale25
Engager

I have successfully implemented hiding panels in a dashboard that I'm not using base searches. But, when I apply the same logic to a base search run dashboard, I'm not getting the expected results.

Any clues as to why this is?

0 Karma
1 Solution

Vijeta
Influencer

In your base search query you can use the below code to set and unset tokens, based on which you can add depends to your panel that needs to be hidden

<done>
            <condition match="'job.resultCount' >0">
                <set token="show">true</set>
            </condition>
            <condition>
                <unset token="show"/>
            </condition>
        </done>

View solution in original post

DalJeanis
Legend

Not sure what you mean by a "base search run dashboard".

A base search does not have to be in a displayable location. If you are getting inconsistent results when the base search is inside a panel, then move it outside the panel, and use a postprocessing search (doing nothing) with that as the base search. within the panel.

0 Karma

adale25
Engager

Hi DalJeanis,
I've actually had to remove the base search from my dashboard, that was the only way that this could work for me. Thanks for your input on this!

0 Karma

Vijeta
Influencer

In your base search query you can use the below code to set and unset tokens, based on which you can add depends to your panel that needs to be hidden

<done>
            <condition match="'job.resultCount' >0">
                <set token="show">true</set>
            </condition>
            <condition>
                <unset token="show"/>
            </condition>
        </done>

adale25
Engager

Hi Vijeta,
The above code isn't working for me. When I apply this to my search string it hides panels even if they have content. I've tried this with using the "done" tag, like you had specified, as well as using the "progress" tag, and still no luck. Please see my code below. Thanks!

    <panel depends="$panel_show$">
      <table>
        <title>Top 5 Count of CPU Utilization &gt; 80% by Host</title>
        <search base="indexos">
          <query>| where Percent_CPU_Load &gt; 80
| stats count by host
| sort - count
|  head 5</query>
          <done>
            <condition match="'job.resultCount' &gt; 0">
              <set token="panel_show">true</set>
            </condition>
            <condition>
              <unset token="panel_show"></unset>
            </condition>
          </done>
        </search>
0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...