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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...