<?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 Compare IP list from the same search between different weeks in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Compare-IP-list-from-the-same-search-between-different-weeks/m-p/167021#M47545</link>
    <description>&lt;P&gt;I'm newbie with Splunk and I would like to compare IP list that I get with below search:&lt;BR /&gt;
index=com-mng-puppet  host="puppetmaster*" clientip!="::1" | dedup clientip | stats count by clientip&lt;/P&gt;

&lt;P&gt;Between different weeks, because I would like to know new IP's or the IP's weren't recorded in the logs. As I have seen there is different ways. &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Exporting to csv and using set diff, however I don't know how I can do it. I know export to csv, but how would I compare? &lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Using count and stat by IP, I'm not sure that's right&lt;/P&gt;

&lt;P&gt;index=com-mng-puppet  host="servername*" clientip!="::1" | dedup clientip | stats count by clientip [ search earliest=-14d@d latest=-7d@d  source=com-mng-puppet | stats count by clientip | fields clientip ] | stats dc(clientip) as "New IP's this week"&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;What do you recommend me and can you please give any suggestion?&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Fri, 01 Aug 2014 10:46:36 GMT</pubDate>
    <dc:creator>maglez</dc:creator>
    <dc:date>2014-08-01T10:46:36Z</dc:date>
    <item>
      <title>Compare IP list from the same search between different weeks</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-IP-list-from-the-same-search-between-different-weeks/m-p/167021#M47545</link>
      <description>&lt;P&gt;I'm newbie with Splunk and I would like to compare IP list that I get with below search:&lt;BR /&gt;
index=com-mng-puppet  host="puppetmaster*" clientip!="::1" | dedup clientip | stats count by clientip&lt;/P&gt;

&lt;P&gt;Between different weeks, because I would like to know new IP's or the IP's weren't recorded in the logs. As I have seen there is different ways. &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Exporting to csv and using set diff, however I don't know how I can do it. I know export to csv, but how would I compare? &lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Using count and stat by IP, I'm not sure that's right&lt;/P&gt;

&lt;P&gt;index=com-mng-puppet  host="servername*" clientip!="::1" | dedup clientip | stats count by clientip [ search earliest=-14d@d latest=-7d@d  source=com-mng-puppet | stats count by clientip | fields clientip ] | stats dc(clientip) as "New IP's this week"&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;What do you recommend me and can you please give any suggestion?&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2014 10:46:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-IP-list-from-the-same-search-between-different-weeks/m-p/167021#M47545</guid>
      <dc:creator>maglez</dc:creator>
      <dc:date>2014-08-01T10:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Compare IP list from the same search between different weeks</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-IP-list-from-the-same-search-between-different-weeks/m-p/167022#M47546</link>
      <description>&lt;P&gt;What do you do exactly? Do you want to compare the IPs of this week with the ip list of the last week or the last two weeks and filter out just the new ips?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2014 12:50:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-IP-list-from-the-same-search-between-different-weeks/m-p/167022#M47546</guid>
      <dc:creator>C_Sparn</dc:creator>
      <dc:date>2014-08-01T12:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Compare IP list from the same search between different weeks</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-IP-list-from-the-same-search-between-different-weeks/m-p/167023#M47547</link>
      <description>&lt;P&gt;Thanks for your quick response.&lt;/P&gt;

&lt;P&gt;Exactly I want to compare the IPs of this week with the IP list of the last week, with the idea that if there are new IPs send an alert with these new IPs&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2014 12:54:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-IP-list-from-the-same-search-between-different-weeks/m-p/167023#M47547</guid>
      <dc:creator>maglez</dc:creator>
      <dc:date>2014-08-01T12:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: Compare IP list from the same search between different weeks</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-IP-list-from-the-same-search-between-different-weeks/m-p/167024#M47548</link>
      <description>&lt;P&gt;This search will give you new IPs in second week or IPs not recorded in second week.&lt;/P&gt;

&lt;P&gt;Replace the searchtime modifiers accordingly&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index earliest=-15m@m latest=-10m@m | dedup clientip | table clientip | append [search index=my_index earliest=-10m@m latest=-5m@m | dedup clientip | table clientip] | stats count by clientip | where count &amp;lt; 2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Aug 2014 12:57:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-IP-list-from-the-same-search-between-different-weeks/m-p/167024#M47548</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2014-08-01T12:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: Compare IP list from the same search between different weeks</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Compare-IP-list-from-the-same-search-between-different-weeks/m-p/167025#M47549</link>
      <description>&lt;P&gt;Try this using subsearch.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=com-mng-puppet host="puppetmaster*" clientip!="::1" earliest=@w NOT [search index=com-mng-puppet host="puppetmaster*" clientip!="::1" earliest=-1w@w latest=@w | stats count by clientip | table clientip]  | stats count by clientip | table clientip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will get list of clientips from last week (in subsearch) and add the filter so that only the clientips which are not on the list will get selected and reported.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2014 13:16:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Compare-IP-list-from-the-same-search-between-different-weeks/m-p/167025#M47549</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-08-01T13:16:55Z</dc:date>
    </item>
  </channel>
</rss>

