<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to filter a search result based on the results of another search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-search-result-based-on-the-results-of-another/m-p/237005#M70452</link>
    <description>&lt;P&gt;Hi AllenZhang,&lt;/P&gt;

&lt;P&gt;although I'm no fan of sub searches, you can do it with a subsearch:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search AAA | search NOT [ search BBB | table User ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here are some reasons why it is not always a good idea to use subsearch &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.1/Search/Aboutsubsearches#Subsearch_performance"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.1/Search/Aboutsubsearches#Subsearch_performance&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt;&lt;BR /&gt;
Here is run everywhere example which is doing the same without a subsearch:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=_internal OR index=_audit 
 | stats dc(user) AS dc by user,index 
 | stats sum(dc) AS sum values(index) AS index by user 
 | table index user sum 
 | where sum="1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It search in two indexes for users which are only found in one of the indexes.&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jan 2016 20:17:34 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2016-01-19T20:17:34Z</dc:date>
    <item>
      <title>How to filter a search result based on the results of another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-search-result-based-on-the-results-of-another/m-p/237004#M70451</link>
      <description>&lt;P&gt;I have 2 searches:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search AAA|table User
Search BBB|tabble User
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How can I filter the result of Search AAA so it only shows those Users which are NOT found in search BBB?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;Allen&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2016 20:09:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-search-result-based-on-the-results-of-another/m-p/237004#M70451</guid>
      <dc:creator>AllenZhang</dc:creator>
      <dc:date>2016-01-19T20:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a search result based on the results of another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-search-result-based-on-the-results-of-another/m-p/237005#M70452</link>
      <description>&lt;P&gt;Hi AllenZhang,&lt;/P&gt;

&lt;P&gt;although I'm no fan of sub searches, you can do it with a subsearch:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search AAA | search NOT [ search BBB | table User ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here are some reasons why it is not always a good idea to use subsearch &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.1/Search/Aboutsubsearches#Subsearch_performance"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.1/Search/Aboutsubsearches#Subsearch_performance&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt;&lt;BR /&gt;
Here is run everywhere example which is doing the same without a subsearch:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=_internal OR index=_audit 
 | stats dc(user) AS dc by user,index 
 | stats sum(dc) AS sum values(index) AS index by user 
 | table index user sum 
 | where sum="1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It search in two indexes for users which are only found in one of the indexes.&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2016 20:17:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-search-result-based-on-the-results-of-another/m-p/237005#M70452</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-01-19T20:17:34Z</dc:date>
    </item>
  </channel>
</rss>

