Splunk Search

How do I correlate a search with an extracted field?

rsulliman
New Member

Hello,

I'm looking for something simple, but I can't seem to wrap my head around it.

I have this log entry for example from an Amazon Web Services (AWS) API Gateway:

(b028209b-f1be-11e8-9399-dbd8f601ab06) Method completed with status: 504

Now, I have the transaction ID (b028209b-f1be-11e8-9399-dbd8f601ab06) extracted to a field (APIGW_TID). But I'd like to have a search string that correlates to that transaction ID to show all the entries associated with that ID.

For example, this will find the errors, but how to I use the transaction ID associated with that error to see the entire transaction where a 504 occured?

index=APIGW source=*vmuuyq97j4* AND "Method completed with status: 504"

Thanks!

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Try a subsearch. The subsearch will find the transaction ID which will be passed to the main search that finds all events with the ID.

index=APIGW source=vmuuyq97j4 [ index=APIGW source=vmuuyq97j4 "Method completed with status: 504" | rex "\((?<transID>[^\)]+\) Method " | fields transID ]
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...