<?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 differences between two searches with &amp;quot;set diff&amp;quot; command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/504032#M140716</link>
    <description>&lt;P&gt;Thank you so much. Took me a whole day to figure it out, but finally did it. Thank you again.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jun 2020 02:21:51 GMT</pubDate>
    <dc:creator>ephrem3232</dc:creator>
    <dc:date>2020-06-12T02:21:51Z</dc:date>
    <item>
      <title>How to find differences between two searches with "set diff" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185029#M53300</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;It's been more than a week that I am trying to display the difference between two search results in one field using the "| set diff" command diff. However, it seems to be impossible and very difficult. Below is my code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| set diff [search sourcetype=nessus source=*Host_Enumeration* earliest=-3d@d latest=-2d@d | eval day="Yesterday"  | timechart count(dest_ip) by dest_ip] [search sourcetype=nessus source=*Host_Enumeration* earliest=-1d@d latest=now| eval day="Today" |timechart count(dest_ip) by dest_ip]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now, the output of that should be only one dst IP address, but what I get as a result is a big timechart with all the dst IPs. It seems like the "| set diff" command never applied to it? I don't know.&lt;/P&gt;

&lt;P&gt;Can you help me please?&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Evang&lt;/P&gt;</description>
      <pubDate>Sun, 17 Aug 2014 19:03:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185029#M53300</guid>
      <dc:creator>evang_26</dc:creator>
      <dc:date>2014-08-17T19:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to find differences between two searches with "set diff" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185030#M53301</link>
      <description>&lt;P&gt;The output will not be what you want, because you're comparing two sets that will be completely different.&lt;/P&gt;

&lt;P&gt;The first set will have a number of values for &lt;CODE&gt;_time&lt;/CODE&gt; that correspond to the time periods the first search covers, which is from 3 days ago up until 2 days ago. The second set on the other hand will have times that include the last day up until now. So &lt;CODE&gt;set diff&lt;/CODE&gt; will look at these sets, compare them and see that these are different on every line.&lt;/P&gt;

&lt;P&gt;I'm not sure I follow what you want to do with &lt;CODE&gt;timechart&lt;/CODE&gt; if all you want is two sets of IP's (also not sure what the &lt;CODE&gt;eval&lt;/CODE&gt; command before that is for). If you tell us more about what you're trying to achieve it will be easier to help you. &lt;CODE&gt;set diff&lt;/CODE&gt; would be one option, but this sounds like something that should be doable just using subsearches as well.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Aug 2014 06:39:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185030#M53301</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2014-08-18T06:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to find differences between two searches with "set diff" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185031#M53302</link>
      <description>&lt;P&gt;Hi Ayn,&lt;/P&gt;

&lt;P&gt;Thank you for your answer!&lt;/P&gt;

&lt;P&gt;You correctly understanded that I want to compare just two sets of IPs, nothing else. &lt;/P&gt;

&lt;P&gt;No specific reason why I used timechart in the end. About eval, nothing special again, I saw it in an example with set diff.&lt;/P&gt;

&lt;P&gt;I played also with the following (if that is called subsearch) without any results.&lt;/P&gt;

&lt;P&gt;sourcetype=nessus source=&lt;EM&gt;Host_Enumeration&lt;/EM&gt; earliest=-3d@d latest=-2d@d NOT [ search sourcetype=nessus source=&lt;EM&gt;Host_Enumeration&lt;/EM&gt; earliest=-1d@d latest=now] | timechart count(dest_ip) by dest_ip]&lt;/P&gt;

&lt;P&gt;Any ideas, just for the IP set comparison?&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Evangelos&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:21:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185031#M53302</guid>
      <dc:creator>evang_26</dc:creator>
      <dc:date>2020-09-28T17:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to find differences between two searches with "set diff" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185032#M53303</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;P&gt;To get list of dest_ip which are not common between Yesterday and Today.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| set diff [search sourcetype=nessus source=*Host_Enumeration* earliest=-3d@d latest=-2d@d | stats count by dest_ip |table dest_ip] [search sourcetype=nessus source=*Host_Enumeration* earliest=-1d@d latest=now | stats count by dest_ip |table dest_ip]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you need to know list of dest_ip present Yesterday but not Today.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=nessus source=*Host_Enumeration* earliest=-3d@d latest=-2d@d NOT [search sourcetype=nessus source=*Host_Enumeration*  earliest=-1d@d latest=now | stats count by dest_ip | dest_ip]| stats count by dest_ip | dest_ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you need to know list of dest_ip present Today but not Yesterday.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=nessus source=*Host_Enumeration* earliest=-1d@d latest=now NOT [search sourcetype=nessus source=*Host_Enumeration* earliest=-3d@d latest=-2d@d | stats count by dest_ip | dest_ip]| stats count by dest_ip | dest_ip
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Aug 2014 15:55:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185032#M53303</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-08-18T15:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to find differences between two searches with "set diff" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185033#M53304</link>
      <description>&lt;P&gt;Hi somesoni2,&lt;/P&gt;

&lt;P&gt;Thank you for your response. I would go with the first option, that is find which IPs are not in common.&lt;/P&gt;

&lt;P&gt;However, this doesn't work prompting that "dest" command doesn't exist.&lt;/P&gt;

&lt;P&gt;I tried to add the "search" command before dest_ip on each end. That time I saw no error coming, but no results as well.&lt;/P&gt;

&lt;P&gt;Last, I tried removing all the last part, making it end at stats count by dest_ip. I got nothing again, though I know that there is a difference.&lt;/P&gt;

&lt;P&gt;Hmm..&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Evangelos&lt;/P&gt;</description>
      <pubDate>Mon, 18 Aug 2014 16:35:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185033#M53304</guid>
      <dc:creator>evang_26</dc:creator>
      <dc:date>2014-08-18T16:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to find differences between two searches with "set diff" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185034#M53305</link>
      <description>&lt;P&gt;That's my bad, I missed 'table' command there. Try the updated answer.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Aug 2014 17:11:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185034#M53305</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-08-18T17:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to find differences between two searches with "set diff" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185035#M53306</link>
      <description>&lt;P&gt;Hi somesoni2,&lt;/P&gt;

&lt;P&gt;Thank you so much! That worked!&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Evang&lt;/P&gt;</description>
      <pubDate>Mon, 18 Aug 2014 20:24:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185035#M53306</guid>
      <dc:creator>evang_26</dc:creator>
      <dc:date>2014-08-18T20:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to find differences between two searches with "set diff" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185036#M53307</link>
      <description>&lt;P&gt;Thank you! After beating my head against a wall for a week I finally found this Answer. I removed the "stats count by" as the results were the same either way but otherwise, it worked like a charm as is. &lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 08:32:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185036#M53307</guid>
      <dc:creator>meganarellano</dc:creator>
      <dc:date>2017-10-06T08:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to find differences between two searches with "set diff" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185037#M53308</link>
      <description>&lt;P&gt;Can you suggest how to display the results  side by side, rather than one after another?&lt;BR /&gt;
Output:&lt;BR /&gt;
         A                                       B&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;1&lt;BR /&gt;
2&lt;BR /&gt;
3&lt;BR /&gt;
                                                4&lt;BR /&gt;
                                                5&lt;/P&gt;

&lt;P&gt;===================&lt;/P&gt;

&lt;P&gt;I would rather like it be:&lt;/P&gt;

&lt;P&gt;1                                           4&lt;BR /&gt;
2                                           5&lt;BR /&gt;
3&lt;BR /&gt;
etc.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 18:11:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185037#M53308</guid>
      <dc:creator>sarmavempati</dc:creator>
      <dc:date>2018-01-19T18:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to find differences between two searches with "set diff" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185038#M53309</link>
      <description>&lt;P&gt;Formatting lost!&lt;/P&gt;

&lt;P&gt;...A.......................B...&lt;BR /&gt;
...1........................x&lt;BR /&gt;
...2........................x&lt;BR /&gt;
...3.........................x&lt;BR /&gt;
.............................4&lt;/P&gt;

&lt;H2&gt;.............................5&lt;/H2&gt;

&lt;P&gt;Desired:&lt;BR /&gt;
.....A..............B&lt;BR /&gt;
.....1..............4&lt;BR /&gt;
......2.............5&lt;BR /&gt;
......3.................&lt;BR /&gt;
etc.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 18:14:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185038#M53309</guid>
      <dc:creator>sarmavempati</dc:creator>
      <dc:date>2018-01-19T18:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to find differences between two searches with "set diff" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185039#M53310</link>
      <description>&lt;P&gt;This is not working for me.&lt;/P&gt;

&lt;P&gt;index="x"  AND host= y AND "java.&lt;EM&gt;exception&lt;/EM&gt;" AND earliest=-1d@d latest=now &lt;BR /&gt;
 NOT [search  (index=x)   AND (host=y AND "java.&lt;EM&gt;exception&lt;/EM&gt;" AND earliest=-3d@d latest=-2d@d &lt;BR /&gt;
 | rex "(?java?.[.\w]+Exception)" | stats count by Exception | sort by count ]  | rex "(?java?.[.\w]+Exception)" | stats count by Exception | sort by count&lt;/P&gt;

&lt;P&gt;its not listing today' exceptions. Its listing all the exceptions from today and yesterday and ignoring common ones&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 06:08:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185039#M53310</guid>
      <dc:creator>guru89044</dc:creator>
      <dc:date>2018-02-20T06:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to find differences between two searches with "set diff" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185040#M53311</link>
      <description>&lt;P&gt;This example also just returns all the results from the first subsearch, even though both searches return the exact same results&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 17:07:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/185040#M53311</guid>
      <dc:creator>smahone11</dc:creator>
      <dc:date>2018-09-26T17:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to find differences between two searches with "set diff" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/504032#M140716</link>
      <description>&lt;P&gt;Thank you so much. Took me a whole day to figure it out, but finally did it. Thank you again.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 02:21:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-differences-between-two-searches-with-quot-set-diff/m-p/504032#M140716</guid>
      <dc:creator>ephrem3232</dc:creator>
      <dc:date>2020-06-12T02:21:51Z</dc:date>
    </item>
  </channel>
</rss>

