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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...