<?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 compare two fields from two different searches and display results field not exist? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-fields-from-two-different-searches-and/m-p/502029#M195168</link>
    <description>&lt;P&gt;It worked. Thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 15 Oct 2019 14:51:16 GMT</pubDate>
    <dc:creator>graju89</dc:creator>
    <dc:date>2019-10-15T14:51:16Z</dc:date>
    <item>
      <title>How to compare two fields from two different searches and display results field not exist?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-fields-from-two-different-searches-and/m-p/502025#M195164</link>
      <description>&lt;P&gt;I am running 2 different searches and have to compare the each value in one field with the values in the other field. The display result should show field A values which does not exist in field B.&lt;/P&gt;

&lt;P&gt;given data:&lt;/P&gt;

&lt;P&gt;Field A:&lt;BR /&gt;
 1111&lt;BR /&gt;
 2222&lt;BR /&gt;
 2424&lt;BR /&gt;
 3333&lt;BR /&gt;
 4444&lt;/P&gt;

&lt;P&gt;Field B:&lt;BR /&gt;
 3333&lt;BR /&gt;
 1111&lt;BR /&gt;
 4444&lt;BR /&gt;
 3344&lt;BR /&gt;
Results should be something like this table:&lt;/P&gt;

&lt;P&gt;Field A -- &lt;BR /&gt;
 2222&lt;BR /&gt;
 2424&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 13:49:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-fields-from-two-different-searches-and/m-p/502025#M195164</guid>
      <dc:creator>graju89</dc:creator>
      <dc:date>2019-10-15T13:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two fields from two different searches and display results field not exist?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-fields-from-two-different-searches-and/m-p/502026#M195165</link>
      <description>&lt;P&gt;Hi graju89,&lt;BR /&gt;
if results of the second search are less than 50,000, you can run something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=indexA NOT [search index=indexB | rename FieldB AS FieldA | fields FieldA ]
| dedup FieldA
| sort FieldA
| table FieldA
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If instead you could have more than 50,000 results in the second search, you cannot use subsearches and you have to run a search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=indexA OR index=indexB 
| rename FieldB AS FieldA 
| stats dc(index) AS num_indexes values(index) AS index BY FieldA
| where num_indexes=1 AND index=indexA
| table FieldA
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 14:08:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-fields-from-two-different-searches-and/m-p/502026#M195165</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-10-15T14:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two fields from two different searches and display results field not exist?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-fields-from-two-different-searches-and/m-p/502027#M195166</link>
      <description>&lt;P&gt;Assuming your FieldA and FieldB is single valued field, try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search generating FieldA
| where NOT [search which generates FieldB |rename FieldB as FieldA ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Oct 2019 14:08:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-fields-from-two-different-searches-and/m-p/502027#M195166</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-10-15T14:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two fields from two different searches and display results field not exist?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-fields-from-two-different-searches-and/m-p/502028#M195167</link>
      <description>&lt;P&gt;It worked thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 14:51:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-fields-from-two-different-searches-and/m-p/502028#M195167</guid>
      <dc:creator>graju89</dc:creator>
      <dc:date>2019-10-15T14:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two fields from two different searches and display results field not exist?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-fields-from-two-different-searches-and/m-p/502029#M195168</link>
      <description>&lt;P&gt;It worked. Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 14:51:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-fields-from-two-different-searches-and/m-p/502029#M195168</guid>
      <dc:creator>graju89</dc:creator>
      <dc:date>2019-10-15T14:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two fields from two different searches and display results field not exist?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-fields-from-two-different-searches-and/m-p/502030#M195169</link>
      <description>&lt;P&gt;This is substantially faster in most cases:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ndxA
| search NOT
[ search index=ndxB
  | stats count by FieldB
  | fields - count
]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Oct 2019 16:03:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-two-fields-from-two-different-searches-and/m-p/502030#M195169</guid>
      <dc:creator>wmyersas</dc:creator>
      <dc:date>2019-10-15T16:03:22Z</dc:date>
    </item>
  </channel>
</rss>

