<?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: Splunk adding domain to host name in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-adding-domain-to-host-name/m-p/134334#M27607</link>
    <description>&lt;P&gt;You can use a RegEx to get the &lt;CODE&gt;host&lt;/CODE&gt; field from the events, provided &lt;CODE&gt;host&lt;/CODE&gt; is logged in the event somewhere.  You have to configure this in &lt;CODE&gt;props.conf&lt;/CODE&gt; &amp;amp; &lt;CODE&gt;transforms.conf&lt;/CODE&gt;.  Let's say the &lt;CODE&gt;host&lt;/CODE&gt; is the first field in the event, then you do it like this:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::mysource]
TRANSFORMS-ho=hostoverride
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[hostoverride]
DEST_KEY = MetaData:Host
REGEX = ^([^\.,]+)
FORMAT = host::$1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If &lt;CODE&gt;host&lt;/CODE&gt; is not in the event, then adding this line to the &lt;CODE&gt;hostoverride&lt;/CODE&gt; stanza in &lt;CODE&gt;transforms.conf&lt;/CODE&gt; (to tell it to use the current &lt;CODE&gt;host&lt;/CODE&gt; value as the string for the RegEx instead of &lt;CODE&gt;_raw&lt;/CODE&gt;) &lt;EM&gt;might&lt;/EM&gt; work but I have never tried it:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SOURCE_KEY = MetaData:Host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 03 Jun 2015 15:20:05 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2015-06-03T15:20:05Z</dc:date>
    <item>
      <title>Splunk adding domain to host name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-adding-domain-to-host-name/m-p/134333#M27606</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;We have a Splunk deployment that has been adding the domain to the host name field.&lt;/P&gt;

&lt;P&gt;This has been causing issues for our alerts of hosts not reporting to Splunk, because the host name changes from &amp;lt;host name&amp;gt; to &amp;lt;host name&amp;gt;.&amp;lt;domain&amp;gt;.com.&lt;/P&gt;

&lt;P&gt;Is there any way to force just the &amp;lt;host name&amp;gt; and remove the &amp;lt;domain&amp;gt;.com?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2015 14:32:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-adding-domain-to-host-name/m-p/134333#M27606</guid>
      <dc:creator>Volto</dc:creator>
      <dc:date>2015-06-03T14:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk adding domain to host name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-adding-domain-to-host-name/m-p/134334#M27607</link>
      <description>&lt;P&gt;You can use a RegEx to get the &lt;CODE&gt;host&lt;/CODE&gt; field from the events, provided &lt;CODE&gt;host&lt;/CODE&gt; is logged in the event somewhere.  You have to configure this in &lt;CODE&gt;props.conf&lt;/CODE&gt; &amp;amp; &lt;CODE&gt;transforms.conf&lt;/CODE&gt;.  Let's say the &lt;CODE&gt;host&lt;/CODE&gt; is the first field in the event, then you do it like this:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::mysource]
TRANSFORMS-ho=hostoverride
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[hostoverride]
DEST_KEY = MetaData:Host
REGEX = ^([^\.,]+)
FORMAT = host::$1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If &lt;CODE&gt;host&lt;/CODE&gt; is not in the event, then adding this line to the &lt;CODE&gt;hostoverride&lt;/CODE&gt; stanza in &lt;CODE&gt;transforms.conf&lt;/CODE&gt; (to tell it to use the current &lt;CODE&gt;host&lt;/CODE&gt; value as the string for the RegEx instead of &lt;CODE&gt;_raw&lt;/CODE&gt;) &lt;EM&gt;might&lt;/EM&gt; work but I have never tried it:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SOURCE_KEY = MetaData:Host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jun 2015 15:20:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-adding-domain-to-host-name/m-p/134334#M27607</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-03T15:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk adding domain to host name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-adding-domain-to-host-name/m-p/134335#M27608</link>
      <description>&lt;P&gt;So the host field is already being extracted, the issue that I'm seeing is that sometimes Splunk adds the domain to the events and sometimes it doesn't.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2015 17:26:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-adding-domain-to-host-name/m-p/134335#M27608</guid>
      <dc:creator>Volto</dc:creator>
      <dc:date>2015-06-03T17:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk adding domain to host name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-adding-domain-to-host-name/m-p/134336#M27609</link>
      <description>&lt;P&gt;Right, so I am saying "deal with it" and force &lt;CODE&gt;host&lt;/CODE&gt; to be rewritten when this happens.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2015 17:40:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-adding-domain-to-host-name/m-p/134336#M27609</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-03T17:40:40Z</dc:date>
    </item>
  </channel>
</rss>

