Splunk Search

How to use field values from a search results to make a new search non related to the previous one?

edrivera3
Builder

Hi
After a search I extracted the field "test_number". Now I would like to use those extracted field values to make a new search through different data which already contains the field "test_number". At the end, I am expecting to get the events from the new data that contains the same field values.

Tags (2)
0 Karma
1 Solution

sideview
SplunkTrust
SplunkTrust

I think you're looking for subsearches.

<search terms for search 2> [ search <search terms for search 1> | table test_number]

The bracketed search will be run, and what will come out to the outer search in place of the bracketed expression will be something like (test_number=123 OR test_number=345 OR test_number=456)

http://docs.splunk.com/Documentation/Splunk/6.2.2/Search/Usesubsearchtocorrelateevents

However more generally if you aren't familiar with subsearches, you should start from the top and go through the Search manual. Subsearches are frequently overused by new Splunk users in places where other approaches would be simpler and faster.

http://docs.splunk.com/Documentation/Splunk/6.2.2/Search/Aboutsearch

or go through the tutorial. http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchTutorial/WelcometotheSearchTutorial

View solution in original post

sideview
SplunkTrust
SplunkTrust

I think you're looking for subsearches.

<search terms for search 2> [ search <search terms for search 1> | table test_number]

The bracketed search will be run, and what will come out to the outer search in place of the bracketed expression will be something like (test_number=123 OR test_number=345 OR test_number=456)

http://docs.splunk.com/Documentation/Splunk/6.2.2/Search/Usesubsearchtocorrelateevents

However more generally if you aren't familiar with subsearches, you should start from the top and go through the Search manual. Subsearches are frequently overused by new Splunk users in places where other approaches would be simpler and faster.

http://docs.splunk.com/Documentation/Splunk/6.2.2/Search/Aboutsearch

or go through the tutorial. http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchTutorial/WelcometotheSearchTutorial

Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

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

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...