<?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 Convert IPv4 Addresses to decimal in Splunk Enterprise Security</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Convert-IPv4-Addresses-to-decimal/m-p/707243#M12219</link>
    <description>&lt;P&gt;Hello everyone!&lt;/P&gt;&lt;P&gt;I most likely could solve this problem if given enough time, but always seem to never have enough &lt;span class="lia-unicode-emoji" title=":upside_down_face:"&gt;🙃&lt;/span&gt;.&amp;nbsp; Within Enterprise security we pull asset information via LDAPsearch into our ES instance hosted in Splunk Cloud. Within the cn=* field, multiplies for both IP and hostnames. We aim for host fields to be either hostname or nt_host. some of these values though are written as such:&lt;/P&gt;&lt;P&gt;cn=192_168_1_1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to evaluate the existing field and output them as normal decimals when seen. I am assuming I would need an if statement keeping intact hostname values while else performing the conversion. I am not at computer right now but will update with some data and my progress thus far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Dec 2024 01:56:07 GMT</pubDate>
    <dc:creator>Travlin1</dc:creator>
    <dc:date>2024-12-19T01:56:07Z</dc:date>
    <item>
      <title>Convert IPv4 Addresses to decimal</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Convert-IPv4-Addresses-to-decimal/m-p/707243#M12219</link>
      <description>&lt;P&gt;Hello everyone!&lt;/P&gt;&lt;P&gt;I most likely could solve this problem if given enough time, but always seem to never have enough &lt;span class="lia-unicode-emoji" title=":upside_down_face:"&gt;🙃&lt;/span&gt;.&amp;nbsp; Within Enterprise security we pull asset information via LDAPsearch into our ES instance hosted in Splunk Cloud. Within the cn=* field, multiplies for both IP and hostnames. We aim for host fields to be either hostname or nt_host. some of these values though are written as such:&lt;/P&gt;&lt;P&gt;cn=192_168_1_1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to evaluate the existing field and output them as normal decimals when seen. I am assuming I would need an if statement keeping intact hostname values while else performing the conversion. I am not at computer right now but will update with some data and my progress thus far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 01:56:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Convert-IPv4-Addresses-to-decimal/m-p/707243#M12219</guid>
      <dc:creator>Travlin1</dc:creator>
      <dc:date>2024-12-19T01:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IPv4 Addresses to decimal</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Convert-IPv4-Addresses-to-decimal/m-p/707246#M12220</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/252405"&gt;@Travlin1&lt;/a&gt;&amp;nbsp;something like this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval cn=mvappend(
"192_168_1_1",
"10_0_0_5",
"webserver-prod01",
"172_16_32_1",
"database.example.com",
"192_168_0_badformat",
"dev_server_01"
)
| mvexpand cn
| eval converted_host=case(
match(cn, "^\d+_\d+_\d+_\d+$"),
replace(cn, "_", "."),
true(),
cn
)
| eval host_type=case(
match(cn, "^\d+_\d+_\d+_\d+$"),
"ip_address",
true(),
"hostname"
)
| table cn, converted_host, host_type&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this helps, Please Upvote.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 03:32:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Convert-IPv4-Addresses-to-decimal/m-p/707246#M12220</guid>
      <dc:creator>sainag_splunk</dc:creator>
      <dc:date>2024-12-19T03:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IPv4 Addresses to decimal</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Convert-IPv4-Addresses-to-decimal/m-p/707247#M12221</link>
      <description>&lt;P&gt;Something like this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults format=csv data="hostname
cn=192_168_1_1
cn=myhost
otherhostnane"
| rex field=hostname "cn=(?&amp;lt;ipAddr&amp;gt;\d{1,3}[._]\d{1,3}[._]\d{1,3}[._]\d{1,3})"
| eval hostname=coalesce(replace(ipAddr, "_", "."), hostname)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 19 Dec 2024 03:38:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Convert-IPv4-Addresses-to-decimal/m-p/707247#M12221</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-12-19T03:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IPv4 Addresses to decimal</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Convert-IPv4-Addresses-to-decimal/m-p/707325#M12222</link>
      <description>&lt;P&gt;thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/187813"&gt;@sainag_splunk&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;I tried both and results were near same! Sinece the CN field is already extracted I modified the search like this....&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;base search ....   | rex field=cn "(?&amp;lt;ipAddr&amp;gt;\d{1,3}[._]\d{1,3}[._]\d{1,3}[._]\d{1,3})"
| eval cn = coalesce(replace(ipAddr, "_", "."), cn)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;In case anyone runs into this thread later.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Much appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 19:26:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Convert-IPv4-Addresses-to-decimal/m-p/707325#M12222</guid>
      <dc:creator>Travlin1</dc:creator>
      <dc:date>2024-12-19T19:26:56Z</dc:date>
    </item>
  </channel>
</rss>

