Splunk Search

Parsing events within a transaction

gwu
New Member

Here's my search string:

host=abc* source="/log...*" | rex "^[\d|-]+ [\d|:|,]+ (?P<Identifier>[\w\w|_]+)\s" | transaction Company startswith="HelloPhrase" endswith="GoodbyePhrase" | timechart useother=F avg(eval(duration/60)) by Identifier

Within the start/end events, I want to parse and then extract the max of a number that appears within another event and additional information provided there. I've tried to illustrate what I'm looking for...

StartEvent...

Event1 [Number 1, processing size 100]...

Event2...additional information

Event45 [Number 7, processing size 50]...

EndEvent

I want to know how long it takes to complete the task and what the max number is along with the processing size of that event. Any suggestions would be greatly appreciated.

Tags (1)
0 Karma

yannK
Splunk Employee
Splunk Employee

Look at the automatic fields populated by the transaction :
- duration
- eventcount

see http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Transaction

If you want to also distinguish all the values for the events, the individual fields will be turned into multivalue fields,
you can use the multivalue functions like mvcount()

see http://docs.splunk.com/Documentation/Splunk/latest/Search/Parsemultivaluefields

0 Karma

kristian_kolb
Ultra Champion

Hmm some more information, incl sample events would probably be helpful.

For a transaction, the duration field is calculated automatically. Assuming that you extract "Number" as in your pseudo events, somthing like the following to replace the timechart part;

... | stats max(Number) first(duration) by _time

/K

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...