Splunk Search

Why would Transaction with endswith option return incorrect duration?

sanjay_shrestha
Contributor

Following query with Transaction without endswith

host=phenix  ("Scheduler started" OR "Scheduler stopped" OR "Restarting Protocol" OR "Stopping Protocol"  OR "Protocol complete. Process") | transaction date_month date_mday  startswith=("Restarting" OR "started")| stats sum(duration) AS dur by date_mday date_month| eval durInHr=dur/3600

returns

date_mday ____________ date_month ________________ dur ____________ durInHr

30 ____________ april ____________ 34143 ____________ 9.484167

When added endswith option:

host=phenix  ("Scheduler started" OR "Scheduler stopped" OR "Restarting Protocol" OR "Stopping Protocol"  OR "Protocol complete. Process")  endswith="stopped" | transaction date_month date_mday  startswith=("Restarting" OR "started")| stats sum(duration) AS dur by date_mday date_month| eval durInHr=dur/3600

returns

date_mday ____________ date_month ________________ dur ____________ durInHr

30 ____________ april ____________ 126135 ____________ 35.037500

I was hoping to get smaller duration using endswith, which is not the case here.

Tags (2)
0 Karma
1 Solution

sanjay_shrestha
Contributor

Looks like I found the answer. There are events with few repetitive keywords

Restarting
Restarting
stopped
Restarting
stopped
stopped

View solution in original post

0 Karma

sanjay_shrestha
Contributor

Looks like I found the answer. There are events with few repetitive keywords

Restarting
Restarting
stopped
Restarting
stopped
stopped

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