Splunk Search

Transaction duration with no results found, would like the dashboard panel to reflect 0

dbcase
Motivator

Hi,

I have this query

    index=wholesale_app buildTarget=blah product=product1 analyticType=checkpoint |transaction startswith=(Properties.index=61 OR Properties.index=62 OR Properties.index=63) endswith=(NOT Properties.index=61 OR Properties.index=62 OR Properties.index=63)|stats avg(duration) as avgDuration|eval avgDuration = round(avgDuration/60,2)|

Which works just fine, with one exception. If there are no results found the dashboard panel says "no results found". I'd like it to say zero instead. Any thoughts?

Tags (1)
0 Karma
1 Solution

somesoni2
Revered Legend

Try like this

 index=wholesale_app buildTarget=blah product=product1 analyticType=checkpoint |transaction startswith=(Properties.index=61 OR Properties.index=62 OR Properties.index=63) endswith=(NOT Properties.index=61 OR Properties.index=62 OR Properties.index=63)
| appendpipe [| stats count as duration | where duration=0 ]
|stats avg(duration) as avgDuration|eval avgDuration = round(avgDuration/60,2)

View solution in original post

woodcock
Esteemed Legend

Just add this:

| appendpipe [stats count | where count=0]
0 Karma

somesoni2
Revered Legend

Try like this

 index=wholesale_app buildTarget=blah product=product1 analyticType=checkpoint |transaction startswith=(Properties.index=61 OR Properties.index=62 OR Properties.index=63) endswith=(NOT Properties.index=61 OR Properties.index=62 OR Properties.index=63)
| appendpipe [| stats count as duration | where duration=0 ]
|stats avg(duration) as avgDuration|eval avgDuration = round(avgDuration/60,2)

woodcock
Esteemed Legend

jinx again!

0 Karma

dbcase
Motivator

That is pretty elegant! Thank you!!!

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...