Dashboards & Visualizations

Embedded Pie Chart Needs to Show Zero Results

mistydennis
Communicator

I have an embedded pie chart where I'm trying to show something rather than "no results found" with the red exclamation mark, and this is making people think the report isn't working. I've tried several methods to address this, but I can't get the results I would like.
 
Query and results:

| inputlookup my_lookup 
| search Exposure=External 
| stats count by Status 
| eval pie_slice = count + " " + Status 
| fields pie_slice, count

 
Screenshot 2023-02-23 103439.jpg

Is it possible to add something to the query so that when there are zero results I get this?
Screenshot 2023-02-23 104044.jpg

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The appendpipe command usually is used in this case.

| inputlookup my_lookup 
| search Exposure=External 
| stats count by Status 
| appendpipe [ stats count as Count | eval Status="No results",count=1 | where Count=0 | fields - Count ]
| eval pie_slice = count + " " + Status 
| fields pie_slice, count

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The appendpipe command usually is used in this case.

| inputlookup my_lookup 
| search Exposure=External 
| stats count by Status 
| appendpipe [ stats count as Count | eval Status="No results",count=1 | where Count=0 | fields - Count ]
| eval pie_slice = count + " " + Status 
| fields pie_slice, count

 

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to November Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...

Index This | When is October more than just the tenth month?

October 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...