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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...