<?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: I want to obtain IP addresses that is not duplicated. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/I-want-to-obtain-IP-addresses-that-is-not-duplicated/m-p/344185#M159677</link>
    <description>&lt;P&gt;Check this, from a similar post - &lt;/P&gt;

&lt;P&gt;Source1&lt;BR /&gt;
192.168.0.1&lt;BR /&gt;
192.168.0.2&lt;BR /&gt;
192.168.0.3&lt;BR /&gt;
Source2&lt;BR /&gt;
192.168.0.1&lt;BR /&gt;
192.168.0.2&lt;BR /&gt;
192.168.0.4&lt;BR /&gt;
192.168.0.5&lt;/P&gt;

&lt;P&gt;Output&lt;BR /&gt;
192.168.0.3&lt;/P&gt;

&lt;PRE&gt;index=AV "VirusAlert" earliest=-1h | field CLIENTIP | dedup CLIENTIP |  eval ip=VirusAlert_ip | eval source1="Y" | table ip source1 
| join ip type=outer [search index=AV "Remove" earliest=-1h| field CLIENTIP | dedup CLIENTIP | eval ip=Remove_ip |
 eval source2 = "Y" | table ip source2 ] &lt;/PRE&gt;

&lt;P&gt;After you run this command, you should have 3 columns of output: ip source1 source2&lt;/P&gt;

&lt;P&gt;The ip column will be the ip address, of course. The source1 column will contain Y if the ip address existed in source1, and the source2 column will contain Y if the ip address existed in source2. To go further, you could append the following to the search to get the variations that you want&lt;/P&gt;

&lt;P&gt;To only show IPs that appear in both, add: &lt;BR /&gt;
| where source1 = "Y" AND source2 = "Y"&lt;/P&gt;

&lt;P&gt;To only show IPs that appear ONLY in source1, add: &lt;BR /&gt;
| where source1 = "Y" AND source2 != "Y"&lt;/P&gt;

&lt;P&gt;You get the idea. There might be a more efficient way to do this, but this gives you a "base search" that is pretty flexible. You could even put the "base search" in a macro, which would make it even easier to type.&lt;/P&gt;

&lt;P&gt;Note the use of earliest=-1h in the two searches; this will keep your working data size under reasonable control, and help keep the search reasonably quick.&lt;/P&gt;</description>
    <pubDate>Tue, 01 Aug 2017 08:49:34 GMT</pubDate>
    <dc:creator>inventsekar</dc:creator>
    <dc:date>2017-08-01T08:49:34Z</dc:date>
    <item>
      <title>I want to obtain IP addresses that is not duplicated.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-want-to-obtain-IP-addresses-that-is-not-duplicated/m-p/344183#M159675</link>
      <description>&lt;P&gt;I want to get IP addresses that is not duplicated&lt;/P&gt;

&lt;P&gt;There is two example search  that A and B.&lt;/P&gt;

&lt;P&gt;A search is &lt;BR /&gt;
index=AV "VirusAlert" | field CLIENTIP | dedup CLIENTIP&lt;/P&gt;

&lt;P&gt;B search is&lt;BR /&gt;
index=AV "Remove" | field CLIENTIP | dedup CLIENTIP&lt;/P&gt;

&lt;P&gt;I want to get IP addresses except IP addresses in result B.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 08:36:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-want-to-obtain-IP-addresses-that-is-not-duplicated/m-p/344183#M159675</guid>
      <dc:creator>superhm</dc:creator>
      <dc:date>2017-08-01T08:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: I want to obtain IP addresses that is not duplicated.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-want-to-obtain-IP-addresses-that-is-not-duplicated/m-p/344184#M159676</link>
      <description>&lt;P&gt;The simple query can be &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=AV "VirusAlert" | dedup CLIENTIP | table CLIENTIP | search NOT [|search index=AV "Remove" | dedup CLIENTIP | table CLIENTIP] | table CLIENTIP
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Aug 2017 08:48:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-want-to-obtain-IP-addresses-that-is-not-duplicated/m-p/344184#M159676</guid>
      <dc:creator>hardikJsheth</dc:creator>
      <dc:date>2017-08-01T08:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: I want to obtain IP addresses that is not duplicated.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-want-to-obtain-IP-addresses-that-is-not-duplicated/m-p/344185#M159677</link>
      <description>&lt;P&gt;Check this, from a similar post - &lt;/P&gt;

&lt;P&gt;Source1&lt;BR /&gt;
192.168.0.1&lt;BR /&gt;
192.168.0.2&lt;BR /&gt;
192.168.0.3&lt;BR /&gt;
Source2&lt;BR /&gt;
192.168.0.1&lt;BR /&gt;
192.168.0.2&lt;BR /&gt;
192.168.0.4&lt;BR /&gt;
192.168.0.5&lt;/P&gt;

&lt;P&gt;Output&lt;BR /&gt;
192.168.0.3&lt;/P&gt;

&lt;PRE&gt;index=AV "VirusAlert" earliest=-1h | field CLIENTIP | dedup CLIENTIP |  eval ip=VirusAlert_ip | eval source1="Y" | table ip source1 
| join ip type=outer [search index=AV "Remove" earliest=-1h| field CLIENTIP | dedup CLIENTIP | eval ip=Remove_ip |
 eval source2 = "Y" | table ip source2 ] &lt;/PRE&gt;

&lt;P&gt;After you run this command, you should have 3 columns of output: ip source1 source2&lt;/P&gt;

&lt;P&gt;The ip column will be the ip address, of course. The source1 column will contain Y if the ip address existed in source1, and the source2 column will contain Y if the ip address existed in source2. To go further, you could append the following to the search to get the variations that you want&lt;/P&gt;

&lt;P&gt;To only show IPs that appear in both, add: &lt;BR /&gt;
| where source1 = "Y" AND source2 = "Y"&lt;/P&gt;

&lt;P&gt;To only show IPs that appear ONLY in source1, add: &lt;BR /&gt;
| where source1 = "Y" AND source2 != "Y"&lt;/P&gt;

&lt;P&gt;You get the idea. There might be a more efficient way to do this, but this gives you a "base search" that is pretty flexible. You could even put the "base search" in a macro, which would make it even easier to type.&lt;/P&gt;

&lt;P&gt;Note the use of earliest=-1h in the two searches; this will keep your working data size under reasonable control, and help keep the search reasonably quick.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 08:49:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-want-to-obtain-IP-addresses-that-is-not-duplicated/m-p/344185#M159677</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2017-08-01T08:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: I want to obtain IP addresses that is not duplicated.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-want-to-obtain-IP-addresses-that-is-not-duplicated/m-p/344186#M159678</link>
      <description>&lt;P&gt;wow so simple!&lt;BR /&gt;
thank you for your help. : )&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 09:22:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-want-to-obtain-IP-addresses-that-is-not-duplicated/m-p/344186#M159678</guid>
      <dc:creator>superhm</dc:creator>
      <dc:date>2017-08-01T09:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: I want to obtain IP addresses that is not duplicated.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-want-to-obtain-IP-addresses-that-is-not-duplicated/m-p/344187#M159679</link>
      <description>&lt;P&gt;Thank you for your advice!&lt;BR /&gt;
It is very helpful for me.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 09:24:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-want-to-obtain-IP-addresses-that-is-not-duplicated/m-p/344187#M159679</guid>
      <dc:creator>superhm</dc:creator>
      <dc:date>2017-08-01T09:24:32Z</dc:date>
    </item>
  </channel>
</rss>

