<?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: ip2decimal command is exist. Is decimal2ip command exist? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/ip2decimal-command-is-exist-Is-decimal2ip-command-exist/m-p/90302#M97355</link>
    <description>&lt;P&gt;Thanks a lot for you help.&lt;BR /&gt;
I solved problem for your advice.&lt;BR /&gt;
P.S.&lt;BR /&gt;
this is correct.&lt;BR /&gt;
... | eval ip="210.192.120.23" | eval ipdecimal=(tonumber(mvindex(ipmv,0),10)*16777216)+(tonumber(mvindex(ipmv,1),10)*65536)+(tonumber(mvindex(ipmv,2),10)*256)+tonumber(mvindex(ipmv,3),10)&lt;/P&gt;

&lt;P&gt;I appreciate that your help again.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Oct 2011 06:43:26 GMT</pubDate>
    <dc:creator>joy76</dc:creator>
    <dc:date>2011-10-12T06:43:26Z</dc:date>
    <item>
      <title>ip2decimal command is exist. Is decimal2ip command exist?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/ip2decimal-command-is-exist-Is-decimal2ip-command-exist/m-p/90300#M97353</link>
      <description>&lt;P&gt;Hi~&lt;/P&gt;

&lt;P&gt;ip2decimal command is exist. Is decimal2ip command exist?&lt;/P&gt;

&lt;P&gt;example&amp;gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;| eval foo="210.192.120.23" | ip2decimal | table ipdecimal&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;result&amp;gt;&amp;gt;&amp;gt;&amp;gt; ipdecimal=2130706433&lt;/P&gt;

&lt;P&gt;I want convert decimal_ip to dot_ip&lt;BR /&gt;
  "2130706433" &amp;gt;&amp;gt;&amp;gt; "210.192.120.23"&lt;/P&gt;

&lt;P&gt;I will try to make a user command by python.&lt;/P&gt;

&lt;P&gt;take care.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:58:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/ip2decimal-command-is-exist-Is-decimal2ip-command-exist/m-p/90300#M97353</guid>
      <dc:creator>joy76</dc:creator>
      <dc:date>2020-09-28T09:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: ip2decimal command is exist. Is decimal2ip command exist?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/ip2decimal-command-is-exist-Is-decimal2ip-command-exist/m-p/90301#M97354</link>
      <description>&lt;P&gt;First of all, your math seems to be wrong. I don't really know what you're trying to convert, but I don't see how an IP of 210.192.120.23 converts to 2130706433. I could see it converting to hex 0xd2c07817, which is decimal 3535829015. Assuming that's what you're working with, you could simply do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval ipdecimal=3535829015 | eval ip=(floor(ipdecimal/16777216)%256).".".(floor(ipdecimal/65536)%256).".".(floor(ipdecimal/256)%256).".".(ipdecimal%256)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And really, the ip2decimal command is a waste of time. It is much more efficient in Splunk to simply do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval ip="210.192.120.23" | eval ipmv=split(ip,".") | eval ipdecimal=(mvindex(ipmv,0)*16777216)+(mvindex(ipmv,1)*65536)+(mvindex(ipmv,2)*256)+mvindex(ipmv,3)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Oct 2011 05:36:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/ip2decimal-command-is-exist-Is-decimal2ip-command-exist/m-p/90301#M97354</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-10-12T05:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: ip2decimal command is exist. Is decimal2ip command exist?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/ip2decimal-command-is-exist-Is-decimal2ip-command-exist/m-p/90302#M97355</link>
      <description>&lt;P&gt;Thanks a lot for you help.&lt;BR /&gt;
I solved problem for your advice.&lt;BR /&gt;
P.S.&lt;BR /&gt;
this is correct.&lt;BR /&gt;
... | eval ip="210.192.120.23" | eval ipdecimal=(tonumber(mvindex(ipmv,0),10)*16777216)+(tonumber(mvindex(ipmv,1),10)*65536)+(tonumber(mvindex(ipmv,2),10)*256)+tonumber(mvindex(ipmv,3),10)&lt;/P&gt;

&lt;P&gt;I appreciate that your help again.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2011 06:43:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/ip2decimal-command-is-exist-Is-decimal2ip-command-exist/m-p/90302#M97355</guid>
      <dc:creator>joy76</dc:creator>
      <dc:date>2011-10-12T06:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: ip2decimal command is exist. Is decimal2ip command exist?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/ip2decimal-command-is-exist-Is-decimal2ip-command-exist/m-p/90303#M97356</link>
      <description>&lt;P&gt;Hi! &lt;BR /&gt;
You could add this in props.conf (this is two lines, one for DestinationIP-field and one for ClientIP;&lt;/P&gt;

&lt;P&gt;EVAL-dst = if(DestinationIP!=0,tostring(floor(if(DestinationIP&amp;lt;1,DestinationIP+2147483648,DestinationIP)/16777216))+"."+tostring(floor((if(DestinationIP&amp;lt;1,DestinationIP+2147483648,DestinationIP)-floor(if(DestinationIP&amp;lt;1,DestinationIP+2147483648,DestinationIP)/16777216)*16777216)/65536))+"."+tostring(floor((if(DestinationIP&amp;lt;1,DestinationIP+2147483648,DestinationIP)-(floor(if(DestinationIP&amp;lt;1,DestinationIP+2147483648,DestinationIP)/16777216)*16777216+floor((if(DestinationIP&amp;lt;1,DestinationIP+2147483648,DestinationIP)-floor(if(DestinationIP&amp;lt;1,DestinationIP+2147483648,DestinationIP)/16777216)*16777216)/65536)*65536))/256))+"."+tostring(if(DestinationIP&amp;lt;1,DestinationIP+2147483648,DestinationIP)-(floor(if(DestinationIP&amp;lt;1,DestinationIP+2147483648,DestinationIP)/16777216)*16777216+floor((if(DestinationIP&amp;lt;1,DestinationIP+2147483648,DestinationIP)-floor(if(DestinationIP&amp;lt;1,DestinationIP+2147483648,DestinationIP)/16777216)*16777216)/65536)*65536+floor((if(DestinationIP&amp;lt;1,DestinationIP+2147483648,DestinationIP)-(floor(if(DestinationIP&amp;lt;1,DestinationIP+2147483648,DestinationIP)/16777216)*16777216+floor((if(DestinationIP&amp;lt;1,DestinationIP+2147483648,DestinationIP)-floor(if(DestinationIP&amp;lt;1,DestinationIP+2147483648,DestinationIP)/16777216)*16777216)/65536)*65536))/256)*256)),0)&lt;/P&gt;

&lt;P&gt;EVAL-src = if(ClientIP!=0,tostring(floor(if(ClientIP&amp;lt;1,ClientIP+2147483648,ClientIP)/16777216))+"."+tostring(floor((if(ClientIP&amp;lt;1,ClientIP+2147483648,ClientIP)-floor(if(ClientIP&amp;lt;1,ClientIP+2147483648,ClientIP)/16777216)*16777216)/65536))+"."+tostring(floor((if(ClientIP&amp;lt;1,ClientIP+2147483648,ClientIP)-(floor(if(ClientIP&amp;lt;1,ClientIP+2147483648,ClientIP)/16777216)*16777216+floor((if(ClientIP&amp;lt;1,ClientIP+2147483648,ClientIP)-floor(if(ClientIP&amp;lt;1,ClientIP+2147483648,ClientIP)/16777216)*16777216)/65536)*65536))/256))+"."+tostring(if(ClientIP&amp;lt;1,ClientIP+2147483648,ClientIP)-(floor(if(ClientIP&amp;lt;1,ClientIP+2147483648,ClientIP)/16777216)*16777216+floor((if(ClientIP&amp;lt;1,ClientIP+2147483648,ClientIP)-floor(if(ClientIP&amp;lt;1,ClientIP+2147483648,ClientIP)/16777216)*16777216)/65536)*65536+floor((if(ClientIP&amp;lt;1,ClientIP+2147483648,ClientIP)-(floor(if(ClientIP&amp;lt;1,ClientIP+2147483648,ClientIP)/16777216)*16777216+floor((if(ClientIP&amp;lt;1,ClientIP+2147483648,ClientIP)-floor(if(ClientIP&amp;lt;1,ClientIP+2147483648,ClientIP)/16777216)*16777216)/65536)*65536))/256)*256)),0)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:49:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/ip2decimal-command-is-exist-Is-decimal2ip-command-exist/m-p/90303#M97356</guid>
      <dc:creator>magnusmolbach</dc:creator>
      <dc:date>2020-09-29T11:49:44Z</dc:date>
    </item>
  </channel>
</rss>

