Dashboards & Visualizations

"No results found" in dashboard replace with another result

user2020dy
Path Finder

I have a panel in a dashboard running correctly, but the data doesn`t appear in this dashboard every day.

user2020dy_0-1606224233101.png

 

What I want is to know, is it possible to show another panel instead of this, when I get no results in this search query? It is not comfortable to look at this empty hole.

 

I mean, if there are results - show this panel.

If there are no results - show another one instead of this.

Labels (5)
0 Karma
1 Solution

impurush
Contributor

Hi @user2020dy ,

You need to use two different tokens and two different panels to be successful in your requirement. I have faced the same problem and implemented the below code to reach the expected output.

<row>
<panel depends="$value$">
      <title>DNS</title>
      <single>
        <search>
          <progress>
            <condition match="$job.resultCount$&gt;1">
              <set token="novalue">true</set>
              <unset token="value"></unset>
            </condition>
            <condition>
              <set token="value">true</set>
              <unset token="novalue"></unset>
            </condition>
          </progress>
          <query>Your query</query>
          <earliest>-5m</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
      </single>
    </panel>
    <panel depends="$novalue$">
      <title>DNS</title>
      <html>
        <br/>
        <br/>
        <h1 align="center">No Value</h1>
      </html>
    </panel>
</row>




View solution in original post

0 Karma

impurush
Contributor

Hi @user2020dy ,

You need to use two different tokens and two different panels to be successful in your requirement. I have faced the same problem and implemented the below code to reach the expected output.

<row>
<panel depends="$value$">
      <title>DNS</title>
      <single>
        <search>
          <progress>
            <condition match="$job.resultCount$&gt;1">
              <set token="novalue">true</set>
              <unset token="value"></unset>
            </condition>
            <condition>
              <set token="value">true</set>
              <unset token="novalue"></unset>
            </condition>
          </progress>
          <query>Your query</query>
          <earliest>-5m</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
      </single>
    </panel>
    <panel depends="$novalue$">
      <title>DNS</title>
      <html>
        <br/>
        <br/>
        <h1 align="center">No Value</h1>
      </html>
    </panel>
</row>




0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...