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!

Simplifying the Analyst Experience with Finding-based Detections

    Splunk invites you to an engaging Tech Talk focused on streamlining security operations with ...

[Puzzles] Solve, Learn, Repeat: Word Search

This challenge was first posted on Slack #puzzles channelThis puzzle is based on a letter grid containing ...

[Puzzles] Solve, Learn, Repeat: Advent of Code - Day 4

Advent of CodeIn order to participate in these challenges, you will need to register with the Advent of Code ...