<?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 Group IP addresses (integer) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Group-IP-addresses-integer/m-p/60676#M14909</link>
    <description>&lt;P&gt;Problem: Huge list of IP addresses across multiple subnets, how to group and list in order of subnets.&lt;/P&gt;

&lt;P&gt;This is what we came up with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=dhcp dest_ip="10.0.0.0/8" | where dest != dest_ip | stats count(dest) by dest, dest_ip | eval ipoctet=split(dest_ip, ".") | eval int1=floor(tonumber(mvindex(ipoctet,0))*16777216) | eval int2=floor(tonumber(mvindex(ipoctet,1))*65536) | eval int3=floor(tonumber(mvindex(ipoctet,2))*256) | eval ipv4int=int1+int2+int3+(tonumber(mvindex(ipoctet,3))) | sort ipv4int | table dest, dest_ip, ipv4int
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 11 Sep 2013 17:31:41 GMT</pubDate>
    <dc:creator>gstewart</dc:creator>
    <dc:date>2013-09-11T17:31:41Z</dc:date>
    <item>
      <title>Group IP addresses (integer)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-IP-addresses-integer/m-p/60676#M14909</link>
      <description>&lt;P&gt;Problem: Huge list of IP addresses across multiple subnets, how to group and list in order of subnets.&lt;/P&gt;

&lt;P&gt;This is what we came up with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=dhcp dest_ip="10.0.0.0/8" | where dest != dest_ip | stats count(dest) by dest, dest_ip | eval ipoctet=split(dest_ip, ".") | eval int1=floor(tonumber(mvindex(ipoctet,0))*16777216) | eval int2=floor(tonumber(mvindex(ipoctet,1))*65536) | eval int3=floor(tonumber(mvindex(ipoctet,2))*256) | eval ipv4int=int1+int2+int3+(tonumber(mvindex(ipoctet,3))) | sort ipv4int | table dest, dest_ip, ipv4int
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Sep 2013 17:31:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-IP-addresses-integer/m-p/60676#M14909</guid>
      <dc:creator>gstewart</dc:creator>
      <dc:date>2013-09-11T17:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Group IP addresses (integer)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-IP-addresses-integer/m-p/60677#M14910</link>
      <description>&lt;P&gt;What's wrong with;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| sort ip(your_ip_field) | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Sort"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Sort&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2013 17:51:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-IP-addresses-integer/m-p/60677#M14910</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-09-11T17:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Group IP addresses (integer)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-IP-addresses-integer/m-p/60678#M14911</link>
      <description>&lt;P&gt;Other than it's a simple and far more straightforward solution?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2013 18:05:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-IP-addresses-integer/m-p/60678#M14911</guid>
      <dc:creator>gstewart</dc:creator>
      <dc:date>2013-09-11T18:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Group IP addresses (integer)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-IP-addresses-integer/m-p/60679#M14912</link>
      <description>&lt;P&gt;You can also simplify the search in (at least) the following way (not really that much more efficient, but easier to read);&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=dhcp dest_ip=10.* dest!=dest_ip | ...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Perhaps more can be done - depending on log content and your desired outcome.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2013 05:16:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-IP-addresses-integer/m-p/60679#M14912</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-09-12T05:16:42Z</dc:date>
    </item>
  </channel>
</rss>

