Splunk Search

Using search fields to compare against custom command

jgauthier
Contributor

Not the best subject. I'm not sure how to explain it in the title. But I'd like to use the results of an custom search to limit my search results. psuedo-code:

custom_search returns a field named "custom_results"
sourcetype of "xyz" has a field called "expected_results"

sourcetype="xyz" | custom_search | search expected_results=custom_results

However, the search command takes the "results" literally, instead of the field contents.
How is this achieved?

Thanks!

Tags (3)
0 Karma

lguinn2
Legend

Use where instead of search -

sourcetype="xyz" | custom_search | where expected_results=custom_results

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Rethinking Zero Trust: From Product Purchases to Logical Control Evidence

Implementing Zero Trust (ZT) across complex environments often falters at the very beginning due to a ...

Preparing your Splunk Environment for OpenSSL3

The Splunk platform will transition to OpenSSL version 3 in a future release. Actions are required to prepare ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...