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
SplunkTrust
SplunkTrust

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
SplunkTrust
SplunkTrust

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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...