<?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 Dealing with hostnames difference and Lookups in Splunk in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Dealing-with-hostnames-difference-and-Lookups-in-Splunk/m-p/378264#M6255</link>
    <description>&lt;P&gt;I have an issue where my hostnames coming in (mostly from Windows) are full domain name and some are the alias&lt;/P&gt;

&lt;P&gt;hostname vs hostname.domain.com &lt;/P&gt;

&lt;P&gt;I have lookups that I need to have just the alias. How can I get Splunk to give me just the alias.&lt;/P&gt;

&lt;P&gt;Am I going to have to go through the Windows TA and fix all the regexes?&lt;/P&gt;</description>
    <pubDate>Tue, 01 May 2018 14:08:09 GMT</pubDate>
    <dc:creator>jmcclure</dc:creator>
    <dc:date>2018-05-01T14:08:09Z</dc:date>
    <item>
      <title>Dealing with hostnames difference and Lookups in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Dealing-with-hostnames-difference-and-Lookups-in-Splunk/m-p/378264#M6255</link>
      <description>&lt;P&gt;I have an issue where my hostnames coming in (mostly from Windows) are full domain name and some are the alias&lt;/P&gt;

&lt;P&gt;hostname vs hostname.domain.com &lt;/P&gt;

&lt;P&gt;I have lookups that I need to have just the alias. How can I get Splunk to give me just the alias.&lt;/P&gt;

&lt;P&gt;Am I going to have to go through the Windows TA and fix all the regexes?&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 14:08:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Dealing-with-hostnames-difference-and-Lookups-in-Splunk/m-p/378264#M6255</guid>
      <dc:creator>jmcclure</dc:creator>
      <dc:date>2018-05-01T14:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with hostnames difference and Lookups in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Dealing-with-hostnames-difference-and-Lookups-in-Splunk/m-p/378265#M6256</link>
      <description>&lt;P&gt;There's a couple of things you can do:&lt;/P&gt;

&lt;P&gt;1) At search time you can add the following (assuming it's your host field that contains the fully qualified domain name):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;base_search&amp;gt;
| rex field=host "^(?P&amp;lt;hostname&amp;gt;[^\.]+)" 
| eval hostname=lower(hostname)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then you can use the new field "hostname" to do your check against your lookup.&lt;/P&gt;

&lt;P&gt;2) Otherwise you can define a "calculated field" to extract the value out of the fully qualified domain name field:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   lower(mvindex(split(host,"."),0))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This assumes that your FQDN is stored under field 'host', and it will grab everything up to the first period as the value for whatever field you define.&lt;/P&gt;

&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 15:20:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Dealing-with-hostnames-difference-and-Lookups-in-Splunk/m-p/378265#M6256</guid>
      <dc:creator>aholzer</dc:creator>
      <dc:date>2018-05-01T15:20:05Z</dc:date>
    </item>
  </channel>
</rss>

