Splunk Search

Transaction command replies transaction duration for multiple start events and same stop event

zakyx88
New Member

Hi All,

I'm trying to figure out a query that can give me the transaction time of the earliest occurrence of the start event till the stop event to calculate the average transaction times.

For example:

12:00 - start event
12:01 - start event
12:02 - start event
12:03 - stop event
12:04 - start event
12:05 - start event
12:06 - start event
12:07 - start event
12:08 - stop event
12:09 - start event
12:10 - stop event

transaction startswith="start" endsswith="stop"

Out put is:
12:00 - start event
12:03 - stop event

-duration: 3
12:01 - start event
12:03 - stop event

-duration: 2
12:02 - start event
12:03 - stop event

-duration: 1
12:04 - start event
12:08 - stop event

-duration: 4
12:05 - start event
12:08 - stop event

-duration: 3
12:06 - start event
12:08 - stop event

-duration: 2
12:07 - start event
12:08 - stop event

-duration: 1
12:09 - start event
12:10 - stop event

-duration:1

The problem here is that it calculates for every start event till the next stop event the duration time... but I want only the first occurrence or the event with the longest duration:

12:00 - start event
12:03 - stop event

-duration: 3
12:04 - start event
12:08 - stop event

-duration: 4
12:09 - start event
12:10 - stop event

-duration:1

In this case, I don't want the "retry" events of my start event to be in the end result (they are logged with the same statements as the initial one). Can somebody provide some help on how to achieve this?

0 Karma

Richfez
SplunkTrust
SplunkTrust

I believe this works, if it does and it's good for you I can convert to an answer.

If you leave off the start=... parameter, it should do what you want.

transaction endswith="stop"

Can you try and see if that works better?

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...