Splunk Search

How to display the bar with both values even when there are no results for failed?

splunkuser320
Path Finder

I have a bar graph that shows the status (Success and failed). I want to display the bar with both values even when there are no results for failed.  Currently, it shows a bar with only success status. 

 

 

Labels (2)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @splunkuser320 ,

as @ITWhisperer said, if you could share your code, it's easier to help you, anyway, supposing your code, you could use something like this:

<your_search>
| timechart count BY host 
| eval 
   failed=if(isnull(failed),0,failed), 
   success=if(isnull(success),0,success)

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @splunkuser320 ,

as @ITWhisperer said, if you could share your code, it's easier to help you, anyway, supposing your code, you could use something like this:

<your_search>
| timechart count BY host 
| eval 
   failed=if(isnull(failed),0,failed), 
   success=if(isnull(success),0,success)

Ciao.

Giuseppe

ITWhisperer
SplunkTrust
SplunkTrust

Please share your current SPL, preferably in a code block </>

0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

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

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...