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!

Announcing Scheduled Export GA for Dashboard Studio

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

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...