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!

Set Up More Secure Configurations in Splunk Enterprise With Config Assist

This blog post is part 3 of 4 of a series on Splunk Assist. Click the links below to see the other ...

Observability Highlights | November 2022 Newsletter

 November 2022Observability CloudEnd Of Support Extension for SignalFx Smart AgentSplunk is extending the End ...

Enterprise Security Content Update (ESCU) v3.54.0

The Splunk Threat Research Team (STRT) recently released Enterprise Security Content Update (ESCU) v3.54.0 and ...