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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...