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!

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...