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!

Routing Data to Different Splunk Indexes in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. The OpenTelemetry project is the second largest ...

Getting Started with AIOps: Event Correlation Basics and Alert Storm Detection in ...

Getting Started with AIOps:Event Correlation Basics and Alert Storm Detection in Splunk IT Service ...

Register to Attend BSides SPL 2022 - It's all Happening October 18!

Join like-minded individuals for technical sessions on everything Splunk!  This is a community-led and run ...