Dashboards & Visualizations

How do I display "no data found" message when there are no search results displayed for each dashboard panel?

smuppava
Explorer

How do I display message to the user saying "No data found" on the dashboard panel when each of the panels returns no data at all. Currently, I am hiding panels when no search results are displayed for the dashboard. So, my dashboard shows as blank when no data is been returned.

I would like to display a user friendly message to the user saying "No data found" when all the panels in my dashboard returns no results.

Thx for your help,
Sirisha

lquinn
Contributor

Is your dashboard in XML or HTML?

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi smuppava,
You could see an example in Dashboard Examples app (you can download it from appbase https://splunkbase.splunk.com/app/1603/), showing an html message instead of "No data found".
something like this

  <search id="search_logic">
    <query>
      mysearch
    </query>
    <!-- Progress event has access to job properties only -->
    <progress>
      <condition match="'job.resultCount' == 0">
        <set token="show_html">foob</set>
      </condition>
      <condition>
        <unset token="show_html"></unset>
      </condition>
    </progress>
  </search>
  <row>
    <panel>
      <chart rejects="$show_html$">
        <title>XXXXXXXXXXXXXXXXXXXXXXXXXX</title>
        <search>
          <query>
              myquery
          </query>
          <earliest>0</earliest>
          <latest></latest>
          <progress>
            <set token="count">$job.eventCount$</set>
          </progress>
          <cancelled>
            <unset token="count"></unset>
          </cancelled>
        </search>
        <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
        <option name="charting.axisLabelsX.majorLabelStyle.rotation">0</option>
        <option name="charting.axisTitleX.visibility">visible</option>
        <option name="charting.axisTitleY.visibility">visible</option>
        <option name="charting.axisTitleY2.visibility">visible</option>
        <option name="charting.axisX.scale">linear</option>
        <option name="charting.axisY.scale">linear</option>
        <option name="charting.axisY2.enabled">0</option>
        <option name="charting.axisY2.scale">inherit</option>
        <option name="charting.chart">pie</option>
        <option name="charting.chart.bubbleMaximumSize">50</option>
        <option name="charting.chart.bubbleMinimumSize">10</option>
        <option name="charting.chart.bubbleSizeBy">area</option>
        <option name="charting.chart.nullValueMode">gaps</option>
        <option name="charting.chart.showDataLabels">none</option>
        <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
        <option name="charting.chart.stackMode">default</option>
        <option name="charting.chart.style">shiny</option>
        <option name="charting.drilldown">all</option>
        <option name="charting.layout.splitSeries">0</option>
        <option name="charting.layout.splitSeries.allowIndependentYRanges">0</option>
        <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
        <option name="charting.legend.placement">right</option>
        <option name="wrap">true</option>
        <option name="rowNumbers">false</option>
        <option name="dataOverlayMode">none</option>
        <option name="count">10</option>
      </chart>
      <html depends="$show_html$">
        <p style="color:red;margin-left:30px;font-size:24px">BEWARE:</p>
        <br/>
         <p style="color:blue;margin-left:30px;font-size:24px">message</p>
         <p style="color:blue;margin-left:30px;font-size:24px">message</p>
      </html>
    </panel>

Bye.
Giuseppe

cmerriman
Super Champion

i just helped someone with this the other day

https://answers.splunk.com/answers/467823/if-there-are-no-results-found-how-do-i-get-my-sear.html#an...

use | appendpipe [ stats count | eval "NoResults"="No Data Found" | where count=0 |table "NoResults"]

smuppava
Explorer

I incorporated the above code into my query. But didn't work.

index=eapi_cloud_system_qa id-swiftid-green-ITE-app sourcetype=monitor OR sourcetype=monitor_log | appendpipe [ stats count | eval "NoResults"="No Data Found" | where count=0 |table "NoResults"]|rex field=_raw "(EC2-CPUUtilization-Percent)\w | ^:" | rex field=_raw "(Host-ProcessCPUUtilization-Percent)\w | ^:" |chart values(ec2cpu) as EC2_CPUUtilization values(processcpu) AS Process_CPUUtilization by _time span=1m

0 Karma

cmerriman
Super Champion

try placing the append at the very end.

index=eapi_cloud_system_qa id-swiftid-green-ITE-app sourcetype=monitor OR sourcetype=monitor_log|rex field=_raw "(EC2-CPUUtilization-Percent)[\w | ^:](?P[\w]+)" | rex field=_raw "(Host-ProcessCPUUtilization-Percent)[\w | ^:](?P[\w]+)" |chart values(ec2cpu) as EC2_CPUUtilization values(processcpu) AS Process_CPUUtilization by _time span=1m | appendpipe [ stats count | eval "NoResults"="No Data Found" | where count=0 |table "NoResults"]
0 Karma

smuppava
Explorer

The above query given results in a row being displayed with 3 columns and 1 column displays no data found

0 Karma

skoelpin
SplunkTrust
SplunkTrust
0 Karma

smuppava
Explorer

This doesn't help!

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...