<?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: find missing ip's from search1 in search2 and find the stats percentage missing ip's in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-missing-ip-s-from-search1-in-search2-and-find-the/m-p/598497#M208406</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/49826"&gt;@kpavan&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you should explore the dc option in stats, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=index1) OR (index=index2)
| eval ip=if(index=index1,ip_1,ip_2)
| stats dc(index) AS dc_index values(index) AS index BY ip
| eval status=case(dc_index=2,"both indexes",dc_index=1 AND index=index1,"only index1",dc_index=1 AND index=index2,"only index2")
| stats dc(ip) AS count BY status&lt;/LI-CODE&gt;&lt;P&gt;In this way you can know if an Ip is present in both the indexes or only in one of them and you can make all the operations you want.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 May 2022 13:48:32 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-05-19T13:48:32Z</dc:date>
    <item>
      <title>How to find missing ip's from search1 in search2 and find the stats percentage missing ip's?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-missing-ip-s-from-search1-in-search2-and-find-the/m-p/598488#M208403</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;am trying to find list of ip's from search1 which are missing in search2 and get all the ip from search1 and calculate the percentage of missing ip's. This will help to identify the number of ip's.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 16:15:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-missing-ip-s-from-search1-in-search2-and-find-the/m-p/598488#M208403</guid>
      <dc:creator>kpavan</dc:creator>
      <dc:date>2022-05-19T16:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: find missing ip's from search1 in search2 and find the stats percentage missing ip's</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-missing-ip-s-from-search1-in-search2-and-find-the/m-p/598497#M208406</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/49826"&gt;@kpavan&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you should explore the dc option in stats, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=index1) OR (index=index2)
| eval ip=if(index=index1,ip_1,ip_2)
| stats dc(index) AS dc_index values(index) AS index BY ip
| eval status=case(dc_index=2,"both indexes",dc_index=1 AND index=index1,"only index1",dc_index=1 AND index=index2,"only index2")
| stats dc(ip) AS count BY status&lt;/LI-CODE&gt;&lt;P&gt;In this way you can know if an Ip is present in both the indexes or only in one of them and you can make all the operations you want.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 13:48:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-missing-ip-s-from-search1-in-search2-and-find-the/m-p/598497#M208406</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-05-19T13:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: find missing ip's from search1 in search2 and find the stats percentage missing ip's</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-missing-ip-s-from-search1-in-search2-and-find-the/m-p/598502#M208408</link>
      <description>&lt;P&gt;Assuming ip occurs at most once in both searches&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;search1
| eval search=1
| append [search2 | eval search=-1]
| stats sum(search) as search by ip
| stats count(eval(search==1)) as ip1 count
| eval percent=100*ip1/count&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 19 May 2022 13:55:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-missing-ip-s-from-search1-in-search2-and-find-the/m-p/598502#M208408</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-19T13:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to find missing ip's from search1 in search2 and find the stats percentage missing ip's?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-missing-ip-s-from-search1-in-search2-and-find-the/m-p/598534#M208417</link>
      <description>&lt;P&gt;Thanks for both response!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Meanwhile i was working different method like below, I got percentage results, wanted to confirm if this is correct way of doing it? or anything wrong in it.&lt;/P&gt;&lt;P&gt;(&lt;BR /&gt;(index=compliance sourcetype=site1-ip ) OR&lt;BR /&gt;(index=automation sourcetype=site2-asset))&lt;BR /&gt;| eval ip=case(sourcetype="site1-ip", 'src.ip', sourcetype="site2-asset", ip )&lt;BR /&gt;| eval te=if(sourcetype="site2-asset","yes","no")&lt;BR /&gt;| eval ta=if(sourcetype="site1-ip","yes","no")&lt;BR /&gt;| stats max(eval(if(te="yes",1,0))) AS SCANNED max(eval(if(ta="yes",1,0))) AS CTA values(fqdn) as fqdn_ta values(resourceOwner) as ip.owner by ip&lt;BR /&gt;| search (CTA=1)&lt;BR /&gt;| stats count(eval( SCANNED &amp;gt; 0)) AS tes, count(ip) as total&lt;BR /&gt;| eval percent = round((tes/(total))*100,2)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 16:29:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-missing-ip-s-from-search1-in-search2-and-find-the/m-p/598534#M208417</guid>
      <dc:creator>kpavan</dc:creator>
      <dc:date>2022-05-19T16:29:46Z</dc:date>
    </item>
  </channel>
</rss>

