Splunk Search

Extract a field which apears only in the first event of a transaction

eisaak
Engager

I have the following to display average latency.
It can be accelerated (vs. using the transaction command).
Now I would like to update this to "average latency per request type". Bu the requestType can be extracted only from the first event of each of the "transactions" below.

...stats min(_time) AS startOfTransaction max(_time) AS endOfTransaction by context_flow | eval transactionDuration=endOfTransaction-startOfTransaction | bucket startOfTransaction span=1h | eval startOfTransaction = strftime( startOfTransaction,"%m/%d/%Y %I:%M:%S") | stats avg(transactionDuration) as avgDuration by startOfTransaction | chart sum(avgDuration) as "Average Latency in Seconds" by startOfTransaction

1 Solution

martin_mueller
SplunkTrust
SplunkTrust

Include first(requestType) as requestType in your stats calls to carry that field through the entire pipeline.

View solution in original post

martin_mueller
SplunkTrust
SplunkTrust

Include first(requestType) as requestType in your stats calls to carry that field through the entire pipeline.

Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...