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!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...