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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...