<?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: Converting an encoded IP address to dotted decimal in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Converting-an-encoded-IP-address-to-dotted-decimal/m-p/122636#M33066</link>
    <description>&lt;P&gt;OK - This is what worked:&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE&gt;| eval ip=if(enc_ip&amp;lt;1,enc_ip+2147483648,enc_ip) | eval aaa=floor(ip/16777216) | eval     bbb=floor((ip-aaa\*16777216)/65536) | eval ccc=floor((ip-(aaa\*16777216+bbb\*65536))/256)| eval ddd=ip-(aaa\*16777216+bbb\*65536+ccc\*256) | eval ipv4=tostring(ddd)+"."+tostring(ccc)+"."+tostring(bbb)+"."+tostring(aaa)&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;I adapted this from &lt;A href="http://answers.splunk.com/answers/38750/how-to-convert-ip" target="_blank"&gt;http://answers.splunk.com/answers/38750/how-to-convert-ip&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 15:08:44 GMT</pubDate>
    <dc:creator>wbfoxii</dc:creator>
    <dc:date>2020-09-28T15:08:44Z</dc:date>
    <item>
      <title>Converting an encoded IP address to dotted decimal</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-an-encoded-IP-address-to-dotted-decimal/m-p/122634#M33064</link>
      <description>&lt;P&gt;I've got a log that includes an obfuscated IP address.  The source takes dotted decimal, reverses the order of the octets, converts them to binary, concatenates them, and then converts to decimal.&lt;/P&gt;

&lt;P&gt;For example:&lt;BR /&gt;
10.9.8.7 is turned around:&lt;BR /&gt;
7  8  9  10&lt;BR /&gt;
Then the octets are changed to binary:&lt;BR /&gt;
00000111 00001000 00001001 00001010&lt;BR /&gt;
Then all smashed together:&lt;BR /&gt;
00000111000010000000100100001010&lt;BR /&gt;
Then converted to a decimal number:&lt;BR /&gt;
117967114&lt;BR /&gt;
And that's what I get in the log.  Are there any fun tools in Splunk that would help?  If the set were limited, I could just use a lookup table.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2013 17:27:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-an-encoded-IP-address-to-dotted-decimal/m-p/122634#M33064</guid>
      <dc:creator>wbfoxii</dc:creator>
      <dc:date>2013-10-30T17:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Converting an encoded IP address to dotted decimal</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-an-encoded-IP-address-to-dotted-decimal/m-p/122635#M33065</link>
      <description>&lt;P&gt;You could write a script to evaluate the obfuscated data - here is something similar from a Splunk blog post:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://blogs.splunk.com/2011/07/19/the-naughty-bits-how-to-splunk-binary-logfiles/"&gt;http://blogs.splunk.com/2011/07/19/the-naughty-bits-how-to-splunk-binary-logfiles/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2013 17:45:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-an-encoded-IP-address-to-dotted-decimal/m-p/122635#M33065</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-10-30T17:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Converting an encoded IP address to dotted decimal</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-an-encoded-IP-address-to-dotted-decimal/m-p/122636#M33066</link>
      <description>&lt;P&gt;OK - This is what worked:&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE&gt;| eval ip=if(enc_ip&amp;lt;1,enc_ip+2147483648,enc_ip) | eval aaa=floor(ip/16777216) | eval     bbb=floor((ip-aaa\*16777216)/65536) | eval ccc=floor((ip-(aaa\*16777216+bbb\*65536))/256)| eval ddd=ip-(aaa\*16777216+bbb\*65536+ccc\*256) | eval ipv4=tostring(ddd)+"."+tostring(ccc)+"."+tostring(bbb)+"."+tostring(aaa)&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;I adapted this from &lt;A href="http://answers.splunk.com/answers/38750/how-to-convert-ip" target="_blank"&gt;http://answers.splunk.com/answers/38750/how-to-convert-ip&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:08:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-an-encoded-IP-address-to-dotted-decimal/m-p/122636#M33066</guid>
      <dc:creator>wbfoxii</dc:creator>
      <dc:date>2020-09-28T15:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Converting an encoded IP address to dotted decimal</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-an-encoded-IP-address-to-dotted-decimal/m-p/122637#M33067</link>
      <description>&lt;P&gt;Very clever.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2013 18:31:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-an-encoded-IP-address-to-dotted-decimal/m-p/122637#M33067</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-10-30T18:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Converting an encoded IP address to dotted decimal</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-an-encoded-IP-address-to-dotted-decimal/m-p/122638#M33068</link>
      <description>&lt;P&gt;One question, which is the source field, i mean, the field with the decimal IP? enc_ip?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2015 15:41:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-an-encoded-IP-address-to-dotted-decimal/m-p/122638#M33068</guid>
      <dc:creator>changux</dc:creator>
      <dc:date>2015-06-05T15:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Converting an encoded IP address to dotted decimal</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-an-encoded-IP-address-to-dotted-decimal/m-p/122639#M33069</link>
      <description>&lt;P&gt;What if you want to match the ip against another CSV file to see if it falls in the range?&lt;BR /&gt;
looks like this&lt;BR /&gt;
(( 3743019008, -----&amp;gt; this is actually 223.25.240.0 if converted to IP format&lt;BR /&gt;
3743020031, -----&amp;gt; range end 223.25.243.255&lt;BR /&gt;
'&lt;A href="http://thegigabit.com/'"&gt;http://thegigabit.com/'&lt;/A&gt;),&lt;/P&gt;</description>
      <pubDate>Sat, 23 Dec 2017 19:45:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-an-encoded-IP-address-to-dotted-decimal/m-p/122639#M33069</guid>
      <dc:creator>spark2310</dc:creator>
      <dc:date>2017-12-23T19:45:25Z</dc:date>
    </item>
  </channel>
</rss>

