<?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: ip address in non usual format in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/ip-address-in-non-usual-format/m-p/137229#M37589</link>
    <description>&lt;P&gt;Translating this process to eval statements will take a bit of finagling and I'll have to come back to it later, as the hex string could be variable length, and you'd want to split into up to 2 character segments starting from the back and working forward. strike that, you'd want to do divisions of powers of 256&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jun 2015 15:36:06 GMT</pubDate>
    <dc:creator>acharlieh</dc:creator>
    <dc:date>2015-06-05T15:36:06Z</dc:date>
    <item>
      <title>ip address in non usual format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ip-address-in-non-usual-format/m-p/137227#M37587</link>
      <description>&lt;P&gt;Hi all. I have a mcafee logging in a SQL database with a field:&lt;/P&gt;

&lt;P&gt;sourceip=739840322&lt;/P&gt;

&lt;P&gt;How i can traslate this Ip to a standard IP format? &lt;/P&gt;

&lt;P&gt;What format is that?&lt;/P&gt;

&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2015 15:16:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ip-address-in-non-usual-format/m-p/137227#M37587</guid>
      <dc:creator>changux</dc:creator>
      <dc:date>2015-06-05T15:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: ip address in non usual format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ip-address-in-non-usual-format/m-p/137228#M37588</link>
      <description>&lt;P&gt;If I had to guess, that looks like the decimal representation of an IPv4 address. &lt;/P&gt;

&lt;P&gt;If we convert to that number to Hex, you wind up with 2C191142&lt;/P&gt;

&lt;P&gt;which if we take as a byte at a time translates to: 44.25.17.66&lt;/P&gt;

&lt;P&gt;A first pass at eval statements to make the conversion is: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search
| eval remainder=sourceip
| eval firstoctet=floor(remainder/pow(256,3)) | eval remainder=remainder-(firstoctet*pow(256,3))
| eval secondoctet=floor(remainder/pow(256,2)) | eval remainder=remainder-secondoctet*pow(256,2)
| eval thirdoctet=floor(remainder/pow(256,1)) | eval remainder=remainder-thirdoctet*pow(256,1)
| eval sourceip_string=firstoctet+"."+secondoctet+"."+thirdoctet+"."+remainder
| fields sourceip*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But of course that assumes you only have IPv4 addresses stored there and it feels very clunky, but it works.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2015 15:27:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ip-address-in-non-usual-format/m-p/137228#M37588</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-06-05T15:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: ip address in non usual format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ip-address-in-non-usual-format/m-p/137229#M37589</link>
      <description>&lt;P&gt;Translating this process to eval statements will take a bit of finagling and I'll have to come back to it later, as the hex string could be variable length, and you'd want to split into up to 2 character segments starting from the back and working forward. strike that, you'd want to do divisions of powers of 256&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2015 15:36:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ip-address-in-non-usual-format/m-p/137229#M37589</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-06-05T15:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: ip address in non usual format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ip-address-in-non-usual-format/m-p/137230#M37590</link>
      <description>&lt;P&gt;Any suggestion of eval to do the change?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2015 15:39:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ip-address-in-non-usual-format/m-p/137230#M37590</guid>
      <dc:creator>changux</dc:creator>
      <dc:date>2015-06-05T15:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: ip address in non usual format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ip-address-in-non-usual-format/m-p/137231#M37591</link>
      <description>&lt;P&gt;I made a first pass at a chain of several. That could likely be cleaned up to get down to one or two, but it'd take some finagling. The fields command probably you'd want to adjust to get rid of the in progress steps.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2015 15:48:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ip-address-in-non-usual-format/m-p/137231#M37591</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-06-05T15:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: ip address in non usual format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ip-address-in-non-usual-format/m-p/137232#M37592</link>
      <description>&lt;P&gt;My field is named sourceip4, how i can use with your suggestion?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2015 15:50:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ip-address-in-non-usual-format/m-p/137232#M37592</guid>
      <dc:creator>changux</dc:creator>
      <dc:date>2015-06-05T15:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: ip address in non usual format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ip-address-in-non-usual-format/m-p/137233#M37593</link>
      <description>&lt;P&gt;Change the first line: &lt;CODE&gt;| eval remainder=sourceip&lt;/CODE&gt; to  &lt;CODE&gt;| eval remainder=sourceip4&lt;/CODE&gt; You may want to also look at playing with the last eval (where all the octets are assembled) and the fields to clean up the steps in the middle.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2015 15:52:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ip-address-in-non-usual-format/m-p/137233#M37593</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-06-05T15:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: ip address in non usual format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/ip-address-in-non-usual-format/m-p/137234#M37594</link>
      <description>&lt;P&gt;I wrote a command to do this.  I uploaded it to github: &lt;A href="https://github.com/rzzldzzl/splunk_dec2ip_command"&gt;https://github.com/rzzldzzl/splunk_dec2ip_command&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$ splunk search '| stats count | fields - count | eval dec_ip="739840322" | dec_ip ip4'
 dec_ip       ip4
--------- -----------
739840322 44.25.17.66
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Joe&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2015 20:53:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/ip-address-in-non-usual-format/m-p/137234#M37594</guid>
      <dc:creator>jrizzo_splunk</dc:creator>
      <dc:date>2015-06-09T20:53:35Z</dc:date>
    </item>
  </channel>
</rss>

