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