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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...