<?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: Short hostnames appear as IP address in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Short-hostnames-appear-as-IP-address/m-p/38151#M7002</link>
    <description>&lt;P&gt;The quick answer is yes, you can modify the settings in the &lt;CODE&gt;.../default/transforms.conf&lt;/CODE&gt; by creating a stanza of the same name in the `...local/transforms.conf' file.&lt;/P&gt;

&lt;P&gt;The default settings are based on what we expect &lt;CODE&gt;syslog&lt;/CODE&gt; data to look like but it's not going to match every possible format out there.  Just remember than any changes you make to files in the &lt;CODE&gt;default&lt;/CODE&gt; directories may get overwritten on an upgrade, so make sure you always make your changes in the &lt;CODE&gt;local&lt;/CODE&gt; directory.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jul 2011 21:41:18 GMT</pubDate>
    <dc:creator>Mick</dc:creator>
    <dc:date>2011-07-05T21:41:18Z</dc:date>
    <item>
      <title>Short hostnames appear as IP address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Short-hostnames-appear-as-IP-address/m-p/38150#M7001</link>
      <description>&lt;P&gt;I have a problem where I can not find syslog messages for certain hosts based on the "host" field.  e.g. the search host="h1" returns no results for my system with the hostname h1.  If I search for simply "h1", I can find the results I want.  But I notice then that the "host" field is showing the IP address of h1, rather than h1 as it should.  Through experimentation, I have found that this happens for any host where the host name is 2 characters or less.  Any host name that is at least 3 characters long works.&lt;/P&gt;

&lt;P&gt;Looking at the transforms.conf file, I think I see the likely causes in the following regular expressions:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;[syslog-host] DEST_KEY = MetaData:Host&lt;BR /&gt;
REGEX =&lt;BR /&gt;
:\d\d\s+(?:\d+\s+|(?:user|daemon|local.?).\w+\s+)*[?(\w[\w.-]{2,})]?\s&lt;BR /&gt;
FORMAT = host::$1&lt;/P&gt;

&lt;P&gt;[syslog-host-full] DEST_KEY =&lt;BR /&gt;
MetaData:Host REGEX =&lt;BR /&gt;
^[^:]&lt;EM&gt;\d\d:\d\d:\d\d[^:]&lt;/EM&gt;?\s((\d+.\d+.\d+.\d+)|(\w[\w.-]{2,})(?=\s+[^\s:]+:))&lt;BR /&gt;
FORMAT = host::$1&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;In both cases, the "{2,}" seems to force a 3 character or greater host name before these expressions will match.  This seems like an arbitrary limit.  Could these be changed to "{1,}" or even "{0,}" to allow 2 or 1 character hostnames?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2011 19:02:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Short-hostnames-appear-as-IP-address/m-p/38150#M7001</guid>
      <dc:creator>mhaverkamp</dc:creator>
      <dc:date>2011-07-05T19:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Short hostnames appear as IP address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Short-hostnames-appear-as-IP-address/m-p/38151#M7002</link>
      <description>&lt;P&gt;The quick answer is yes, you can modify the settings in the &lt;CODE&gt;.../default/transforms.conf&lt;/CODE&gt; by creating a stanza of the same name in the `...local/transforms.conf' file.&lt;/P&gt;

&lt;P&gt;The default settings are based on what we expect &lt;CODE&gt;syslog&lt;/CODE&gt; data to look like but it's not going to match every possible format out there.  Just remember than any changes you make to files in the &lt;CODE&gt;default&lt;/CODE&gt; directories may get overwritten on an upgrade, so make sure you always make your changes in the &lt;CODE&gt;local&lt;/CODE&gt; directory.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2011 21:41:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Short-hostnames-appear-as-IP-address/m-p/38151#M7002</guid>
      <dc:creator>Mick</dc:creator>
      <dc:date>2011-07-05T21:41:18Z</dc:date>
    </item>
  </channel>
</rss>

