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!

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

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...