<?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 find the difference of two query results? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-difference-of-two-query-results/m-p/421670#M121093</link>
    <description>&lt;P&gt;No luck @somesoni2.. &lt;/P&gt;</description>
    <pubDate>Tue, 23 Apr 2019 08:36:59 GMT</pubDate>
    <dc:creator>pench2k19</dc:creator>
    <dc:date>2019-04-23T08:36:59Z</dc:date>
    <item>
      <title>How  to find the difference of two query results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-difference-of-two-query-results/m-p/421668#M121091</link>
      <description>&lt;P&gt;Hi team,&lt;/P&gt;

&lt;P&gt;I have two queries as follows&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;query1:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup  abc.csv |table file  sla_time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;query2:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xxx   source=yyyy |table file2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;file2&lt;/STRONG&gt; values are subset of &lt;STRONG&gt;file&lt;/STRONG&gt; values. I want to print the difference between the  &lt;STRONG&gt;file&lt;/STRONG&gt;  and &lt;STRONG&gt;file2&lt;/STRONG&gt; fields along with the &lt;STRONG&gt;sla_time&lt;/STRONG&gt; from the first query.&lt;/P&gt;

&lt;P&gt;Can you help me here&lt;/P&gt;

&lt;P&gt;@jkat54 @vnravikumar &lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2019 17:50:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-difference-of-two-query-results/m-p/421668#M121091</guid>
      <dc:creator>pench2k19</dc:creator>
      <dc:date>2019-04-22T17:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: How  to find the difference of two query results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-difference-of-two-query-results/m-p/421669#M121092</link>
      <description>&lt;P&gt;Give this a try (giving list of file and corresponding sla_time from lookup abc.csv, which doesn't have a matching row in the search)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xxx source=yyyy |stats count by file2  | rename file2 as file
| append [|inputlookup abc.csv |table file sla_time]
| stats values(sla_time) as sla_time values(count) as count by file
| where isnull(count) 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Apr 2019 18:06:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-difference-of-two-query-results/m-p/421669#M121092</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-04-22T18:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: How  to find the difference of two query results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-difference-of-two-query-results/m-p/421670#M121093</link>
      <description>&lt;P&gt;No luck @somesoni2.. &lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2019 08:36:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-difference-of-two-query-results/m-p/421670#M121093</guid>
      <dc:creator>pench2k19</dc:creator>
      <dc:date>2019-04-23T08:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: How  to find the difference of two query results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-difference-of-two-query-results/m-p/421671#M121094</link>
      <description>&lt;P&gt;Hi @pench2k19,&lt;BR /&gt;
      You can use set difference for this purpose. This is similar to set in normal programming language or mathematics so this is even easy to understood. At the end use lookup command to get sla_time field.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| set diff [|inputlookup abc.csv |table file] [index=xxx source=yyyy | rename file2 as file|table file] | lookup abc.csv file output sla_time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps!!!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2019 13:37:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-difference-of-two-query-results/m-p/421671#M121094</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2019-04-23T13:37:43Z</dc:date>
    </item>
  </channel>
</rss>

