<?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: Append Domain name at index time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344118#M101944</link>
    <description>&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/516528/change-host-at-index-time.html"&gt;This post&lt;/A&gt; will show you the general approach to modifying your metadata field 'host', adjust RegEx to match properly. &lt;/P&gt;</description>
    <pubDate>Wed, 20 Sep 2017 20:37:12 GMT</pubDate>
    <dc:creator>s2_splunk</dc:creator>
    <dc:date>2017-09-20T20:37:12Z</dc:date>
    <item>
      <title>Append Domain name at index time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344114#M101940</link>
      <description>&lt;P&gt;All, &lt;/P&gt;

&lt;P&gt;I have logs coming in from /var/log/messages and /var/log/maillog which have the hostname not the FQDN. There is just too much change control and politics to get them fixed at the source. Looking for a way at index time to just make the correction. &lt;/P&gt;

&lt;P&gt;Server names are well formed 12 characters ending in three numbers. &lt;/P&gt;

&lt;P&gt;So I need to create a props.conf/transforms.conf on my indexer, just not sure what it will look like. &lt;/P&gt;

&lt;P&gt;If host = .*\n\n\n then append mycompany.com&lt;/P&gt;

&lt;P&gt;Any ideas what that might look like? &lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 20:18:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344114#M101940</guid>
      <dc:creator>daniel333</dc:creator>
      <dc:date>2017-09-20T20:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Append Domain name at index time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344115#M101941</link>
      <description>&lt;P&gt;Are u listening syslog directly from the Syslog server or you have the syslogd writing to a file in your Splunk server ?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 20:23:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344115#M101941</guid>
      <dc:creator>alemarzu</dc:creator>
      <dc:date>2017-09-20T20:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Append Domain name at index time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344116#M101942</link>
      <description>&lt;P&gt;Splunk for Nix is installed. So it's being gathered locally. &lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 20:27:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344116#M101942</guid>
      <dc:creator>daniel333</dc:creator>
      <dc:date>2017-09-20T20:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Append Domain name at index time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344117#M101943</link>
      <description>&lt;P&gt;This should match any host that does not end with .com, and append mycompany.com onto the current value&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yourstanzaname]
SOURCE_KEY = MetaData:Host
DEST_KEY  = MetaData:Host
REGEX = (.*$)(?&amp;lt;!\.com$)
FORMAT = host::$1mycompany.com
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...or...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = .*$(?&amp;lt;!\.com$)
FORMAT = host::$0mycompany.com
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;Updated, because you meant THAT Host.  &lt;/P&gt;

&lt;P&gt;Just kidding, I just forgot we were talking about an ultra special snowflake of a MetaData field.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/492863/what-happens-if-dest-key-metadatahost.html"&gt;https://answers.splunk.com/answers/492863/what-happens-if-dest-key-metadatahost.html&lt;/A&gt;&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Updated one more time, to change &lt;CODE&gt;\0&lt;/CODE&gt; to &lt;CODE&gt;$0&lt;/CODE&gt; and &lt;CODE&gt;\1&lt;/CODE&gt; to &lt;CODE&gt;$1&lt;/CODE&gt; because contextually we're in a &lt;CODE&gt;.conf&lt;/CODE&gt; file and not a &lt;CODE&gt;rex&lt;/CODE&gt; in &lt;CODE&gt;sed&lt;/CODE&gt; mode.  &lt;/P&gt;

&lt;P&gt;(sigh)&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 20:31:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344117#M101943</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-09-20T20:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Append Domain name at index time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344118#M101944</link>
      <description>&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/516528/change-host-at-index-time.html"&gt;This post&lt;/A&gt; will show you the general approach to modifying your metadata field 'host', adjust RegEx to match properly. &lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 20:37:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344118#M101944</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2017-09-20T20:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Append Domain name at index time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344119#M101945</link>
      <description>&lt;P&gt;Doens't seem to be flying. Tried this config as well as swapping host for MetaData:Host in your DEST_Key. I feel like I am missing something key here. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#props.conf
[syslog]
TRANSFORMS-FIELDS = syslog_fix_fqdn

#transforms.conf
[syslog_fix_fqdn]
SOURCE_KEY = host
DEST_KEY  = host
REGEX = .*$(?&amp;lt;!\.com$)
FORMAT = \0ilovethecompany.com
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Sep 2017 22:43:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344119#M101945</guid>
      <dc:creator>daniel333</dc:creator>
      <dc:date>2017-09-20T22:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Append Domain name at index time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344120#M101946</link>
      <description>&lt;P&gt;@daniel333 - try the new code.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 00:00:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344120#M101946</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-09-21T00:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Append Domain name at index time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344121#M101947</link>
      <description>&lt;P&gt;Thanks for replying! &lt;/P&gt;

&lt;P&gt;I tried the new code and I ended up with my hostnames getting changed to &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\1mycompany.com
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Not following how that capture should work there. How does \1 and \0 refer back to the above regex? &lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 01:10:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344121#M101947</guid>
      <dc:creator>daniel333</dc:creator>
      <dc:date>2017-09-21T01:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Append Domain name at index time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344122#M101948</link>
      <description>&lt;P&gt;@daniel333 - my bad.  Just rechecked the docs, and those slashes should be $s in this location.  Updated.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 18:19:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344122#M101948</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-09-21T18:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: Append Domain name at index time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344123#M101949</link>
      <description>&lt;P&gt;Hey @daniel333 if they solved your problem, please don't forget to accept an answer! You can upvote posts as well. (Karma points will be awarded for either action.) Happy Splunking!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 23:10:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Append-Domain-name-at-index-time/m-p/344123#M101949</guid>
      <dc:creator>lfedak_splunk</dc:creator>
      <dc:date>2017-09-21T23:10:38Z</dc:date>
    </item>
  </channel>
</rss>

