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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...