Splunk Search

How do you create a transaction out of a 500 error?

thompsonsgg
New Member

Hi,
I want to create a single transaction out of a 500 error and a specific type of error thrown immediately after the 500. I have extracted the HTTP status using a regex, but I am unsure of how to specify the 500 error in the transaction. Trying to use just the service and "500" in the starts with command is still giving me 200 status transactions.

index= 
| rex field=message ".*http.*\-\s\[.*\]\s(?[0-9\.]*)\s(?[A-Z]*)\s(?/ots[^\s]*)\s(?[\d]{3})\s(?[^\s]*).*|ErrorCode=\"(?[^\"]+).*?ErrorDescription=\"(?[^\"]+)"
| transaction startswith="ots_*Service 500" endswith="ErrorDescription"
0 Karma

kmorris_splunk
Splunk Employee
Splunk Employee

You can limit the set of events using the base search (the part before the first |). Also, the way transaction works is, it takes a field or fields as arguments to identify all events where those fields match. For example, you may want to group all of the events with the same IP Address, into a single transaction. It will need a common value in order to associate them. The startswith and endswith would be used when there are different events that are happening in a sequence, like, a login, some other stuff happens, then a logout. Another example would be parts of a transaction that could even span different event sources.

Is there a common thread between the 500 error and the error that follows it? I'm guessing IP or host or something?

0 Karma

cmerriman
Super Champion

try using eval in the startswith.

startswith=eval(ErrorCode=500)
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...