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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...