Dashboards & Visualizations

Need to show a zero on a multi stats graph

bigjoe1
New Member

Hi all,

Im tracking three set of stats on one graph two error counts and one success count. However my team has just fixed the issue behind "Error with Initiate Payment" and my graph is now no longer showing the other results.

Is there a way to show the null results as a zero as i would like to monitor this still moving forward.

Below is my query sorry best i can do 🙂 any help will be greatly received.

index=* host=* sourcetype=* "Error with Initiate Payment" | convert timeformat="%Y-%m-%d" ctime(_time) AS Date | stats count AS "Initiate Payment Failures" by Date | join [search index=* host=* sourcetype=* "Error with Submit Payment" | convert timeformat="%Y-%m-%d" ctime(_time) AS Date | stats count as "Submit Payment Failures" by Date] | join [search index=* host=** sourcetype=** "Submit Payment Response {"result":true,"serviceResponse":{"statusCode":200}}" | convert timeformat="%Y-%m-%d" ctime(_time) AS Date | stats count as "Payment Success" by Date]

Tags (2)
0 Karma

marycordova
SplunkTrust
SplunkTrust

Use a "fillnull", assuming these log events are generated even when there is no error.

index= host= sourcetype= "Error with Initiate Payment" | fillnull value="0"

If there literally are no log events generated you could artificially insert a "0" at the end of the search if there are no results:

| stats count as "Payment Success" by Date | eval count=if(isnull('count'),"0",'count')

@marycordova
0 Karma
Get Updates on the Splunk Community!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...