Splunk Search

How to Use Field Values in Endswith Parameter of Transactions

Traer001
Path Finder

Hello!

I am trying to group my log entries based on very specific criteria but can't seem to figure out how to do so.

I have logs like this:

2021-04-23 16:47:26  User Id: 6211 Error Resolved

2021-04-23 16:47:25  Error[0] type 800

2021-04-23 16:47:25  User Id: 2345 Error Resolved

2021-04-23 16:47:23  Error[0] Error Response {"user_id":2345, "error_id":9101, ..............etc}

2021-04-23 16:47:23  Error[0] type 800

2021-04-23 16:47:22  Error[0] Error Response {"user_id":6211, "error_id":9100, ..............etc}

2021-04-23 16:47:22  Error[0] type 800

 

I am trying to get three events in my transactions: (1) the initial error type message, (2) the error response details, and (3) the error resolved message. However, I need the error response details and the error resolved message to contain the same user id. I currently have my query set up like this:

index=INDEX host=HOSTNAME sourcetype=SOURCETYPE
| rex field=_raw "Error\[0\]\stype\s(?<error_code>\d+)"
| rex field=_raw "User\sId:(?<user_id>\d+)\sError\sResolved"
| rex field=_raw "Error\[0\]\sError\sResponse\s{\"user_id\":(?<user_id>\d+)"
| where user_id<20000 or error_code=800
| transaction startswith="Error[0] type 800" endswith="User Id:"

 

I'm lost on how to make sure that the transaction retrieves only the events where the user id of the error response details matches the error resolved message. Any ideas?

Labels (2)
0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Reprocessing XML into Fixed-Length Events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...