<?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 Return results that are in Index1 and NOT in Index2 in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Return-results-that-are-in-Index1-and-NOT-in-Index2/m-p/102538#M26500</link>
    <description>&lt;P&gt;I have two indexes one contains objects of interest and things I don't care about, all_results, and the other is a list of things I know I don't care about, bad_results, I want to return elements of the first list that don't exist in the second. I was able to make it working by using.&lt;/P&gt;

&lt;P&gt;Is there a simpler / better way to do this then something like:&lt;/P&gt;

&lt;P&gt;index=all_results OR index=bad_results | eval isBad=if(index="bad_results", key, 0) | where key!=isBad | transaction key maxspan=1d maxevents=-1&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 14:59:42 GMT</pubDate>
    <dc:creator>tristanmatthews</dc:creator>
    <dc:date>2020-09-28T14:59:42Z</dc:date>
    <item>
      <title>Return results that are in Index1 and NOT in Index2</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-results-that-are-in-Index1-and-NOT-in-Index2/m-p/102538#M26500</link>
      <description>&lt;P&gt;I have two indexes one contains objects of interest and things I don't care about, all_results, and the other is a list of things I know I don't care about, bad_results, I want to return elements of the first list that don't exist in the second. I was able to make it working by using.&lt;/P&gt;

&lt;P&gt;Is there a simpler / better way to do this then something like:&lt;/P&gt;

&lt;P&gt;index=all_results OR index=bad_results | eval isBad=if(index="bad_results", key, 0) | where key!=isBad | transaction key maxspan=1d maxevents=-1&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:59:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-results-that-are-in-Index1-and-NOT-in-Index2/m-p/102538#M26500</guid>
      <dc:creator>tristanmatthews</dc:creator>
      <dc:date>2020-09-28T14:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Return results that are in Index1 and NOT in Index2</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-results-that-are-in-Index1-and-NOT-in-Index2/m-p/102539#M26501</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=all_results NOT [ search index=bad_results | return 10000 key ] 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if you have 10000 or fewer distinct keys in &lt;CODE&gt;bad_results&lt;/CODE&gt; or:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=all_results OR index=bad_results | stats count(eval(index=="bad_results")) as b by key | where b&amp;lt;1 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;doesn't appear simpler than yours, but it runs better if you have a multi-node Splunk system. on the other hand, it doesn't return the whole item, just the key, though you can fix that by adding &lt;CODE&gt;first(otherfield) as otherfield&lt;/CODE&gt; to the stats command.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2013 21:59:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-results-that-are-in-Index1-and-NOT-in-Index2/m-p/102539#M26501</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2013-10-16T21:59:32Z</dc:date>
    </item>
  </channel>
</rss>

