<?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 check CIDR overlaps in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-CIDR-overlaps/m-p/569139#M198360</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to check if CIDR exist in another CIDR&lt;/P&gt;</description>
    <pubDate>Thu, 30 Sep 2021 13:03:38 GMT</pubDate>
    <dc:creator>yko84109</dc:creator>
    <dc:date>2021-09-30T13:03:38Z</dc:date>
    <item>
      <title>How to check CIDR overlaps</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-CIDR-overlaps/m-p/569125#M198355</link>
      <description>&lt;P&gt;I have lookup with CIDR advanced field which contains:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;id    cidr_field

1     1.1.1.1/24

2      8.8.8.8/24&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I search for single if in the range, i.e:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval ip="8.8.8.1"
| lookup mylookup cidr_field as ip OUTPUT id&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's worked currently, But If I'm tried to search for CIDR it does not return any result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval ip="8.8.8.8/28"
| lookup mylookup cidr_field as ip OUTPUT id&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So how can I search for CIDR in another CIDR?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 12:23:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-CIDR-overlaps/m-p/569125#M198355</guid>
      <dc:creator>yko84109</dc:creator>
      <dc:date>2021-09-30T12:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to check CIDR overlaps</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-CIDR-overlaps/m-p/569128#M198356</link>
      <description>&lt;P&gt;Do you want to find overlaps or containment?&lt;/P&gt;&lt;P&gt;Because for simple check whether 1.2.3.4/28 is within a 1.2.0.0/16 range you can just drop the mask from the first IP (as long as it's a valid range and the mask is longer).&lt;/P&gt;&lt;P&gt;And what result would you expect in your comparison of - for example 1.0.0.0/8 versus 1.0.2.0/24? Is 1.0.0.0/8 according to your semantics "in" 1.0.2.0/24 or not?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 12:27:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-CIDR-overlaps/m-p/569128#M198356</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-09-30T12:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to check CIDR overlaps</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-CIDR-overlaps/m-p/569139#M198360</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to check if CIDR exist in another CIDR&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 13:03:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-CIDR-overlaps/m-p/569139#M198360</guid>
      <dc:creator>yko84109</dc:creator>
      <dc:date>2021-09-30T13:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to check CIDR overlaps</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-CIDR-overlaps/m-p/569160#M198372</link>
      <description>&lt;P&gt;Well... you can't really account easily for the cases when the range you want to check is "wider" than the one you have in the lookup.&lt;/P&gt;&lt;P&gt;If your lookup matches the CIDR ranges to unique identifiers, you can try to calculate the "beginning" and "end" of the checked range (possibly using &lt;A href="https://splunkbase.splunk.com/app/3490/" target="_blank"&gt;https://splunkbase.splunk.com/app/3490/&lt;/A&gt; to help) and check if both ends are getting looked up into the same value.&lt;/P&gt;&lt;P&gt;Not a pretty solution, but should work.&lt;/P&gt;&lt;P&gt;Otherwise, you cannot easily detect situations in which you're checking, for example 10.0.0.0/8 against 10.0.0.0/24. Normally the iplookup only checks for a single IP.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 14:38:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-CIDR-overlaps/m-p/569160#M198372</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-09-30T14:38:49Z</dc:date>
    </item>
  </channel>
</rss>

