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
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!

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 ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...