Splunk Search

Use field result from one search to perform another search?

dreamwork801
Path Finder

So I've searched the Splunk answers over and over, and read up on subsearches, but I must not be getting something quite right.

So I've got a subsearch (with the assumption that they are performed first) to search all events for a particular context Id, 123456, and then grabs the PaymentId from that event, and performs the outside search for events with the already found PaymentId, and then can get the fields from that event in a table, as shown below. What am I missing?

Data.Response.Payments{}.PaymentId = Data.Request.Payments{}.PaymentId [search ContextId = fcdc6c40-4ebe-4d0f-9481-ebb1701a6aae Pipeline = "RR" | fields + Data.Request.Payments{}.PaymentId] | table Data.Response.TotalPayablesCount
Tags (1)

martin_mueller
SplunkTrust
SplunkTrust

I believe the first part isn't necessary. Try running this:

[search ContextId = "fcdc6c40-4ebe-4d0f-9481-ebb1701a6aae" Pipeline = "RR" | fields Data.Request.Payments{}.PaymentId] | table Data.Response.TotalPayablesCount
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...