Splunk Search

show value in case of no results found

avivn
Explorer

hello,
I'm trying to do a stats count command and to show "0" (for single value chart) instead of N/A in case the query gets no results found.
i tried fillnull but nothing happened.

thank you

Tags (1)
0 Karma

sundareshr
Legend

Try this

base search returning single value | append [| makeresults | eval samefieldasreturnedbybasesearch=0] | head 1

richgalloway
SplunkTrust
SplunkTrust

If there are no results from your query there is nothing for fillnull to fill.

Try this, replacing processCount with the field from your stats command:

your base search | appendpipe [ stats count | eval processCount=0 | where count==0 | fields - count ]
---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...