<?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: Rewrite hostname don't work in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Rewrite-hostname-don-t-work/m-p/92193#M19154</link>
    <description>&lt;P&gt;I'll check asap&lt;BR /&gt;
Grazie Paolo &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Oct 2011 18:32:15 GMT</pubDate>
    <dc:creator>bizza</dc:creator>
    <dc:date>2011-10-18T18:32:15Z</dc:date>
    <item>
      <title>Rewrite hostname don't work</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Rewrite-hostname-don-t-work/m-p/92190#M19151</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;
I need to append the domain to all hosts that send data to my splunk indexer, to avoid duplications (hostname and hostname.domain are the same host)&lt;/P&gt;

&lt;P&gt;This is my transforms.conf&lt;/P&gt;

&lt;P&gt;[syslog_add_fqdn]&lt;BR /&gt;
REGEX=host::([A-Za-z][-_A-Za-z0-9]*[A-Za-z0-9])$&lt;BR /&gt;
FORMAT=host::$1.domain.local&lt;BR /&gt;
WRITE_META=true&lt;BR /&gt;
DEST_KEY=MetaData:Host&lt;BR /&gt;
SOURCE_KEY=MetaData:Host&lt;/P&gt;

&lt;P&gt;and props.conf&lt;/P&gt;

&lt;P&gt;[linux_secure]&lt;BR /&gt;
TRANSFORMS-zz_fix_host = syslog_add_fqdn&lt;/P&gt;

&lt;P&gt;[syslog]&lt;BR /&gt;
TRANSFORMS-zz_fix_host = syslog_add_fqdn&lt;/P&gt;

&lt;P&gt;In $SPLUNK_HOME/var/log/splunk/splunkd.log I found this error:&lt;/P&gt;

&lt;P&gt;/opt/splunk/var/log/splunk/splunkd.log:10-14-2011 13:22:58.652 +0200 ERROR regexExtractionProcessor - DEST_KEY or WRITE_META=true must be specified tranform_name=syslog_add_fqdn&lt;/P&gt;

&lt;P&gt;What is wrong?&lt;BR /&gt;
I tried to remove WRITE_META from my rules, change its position, but my indexer still log hostname on syslog souce type and hostname.domain on linux_secure source type (because on it my system log fqdn, the rule don't work).&lt;/P&gt;

&lt;P&gt;Any hints?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:59:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Rewrite-hostname-don-t-work/m-p/92190#M19151</guid>
      <dc:creator>bizza</dc:creator>
      <dc:date>2020-09-28T09:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Rewrite hostname don't work</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Rewrite-hostname-don-t-work/m-p/92191#M19152</link>
      <description>&lt;P&gt;I would start troubleshooting the problem by removing the &lt;CODE&gt;host::&lt;/CODE&gt; from the REGEX= line:&lt;BR /&gt;
The &lt;CODE&gt;SOURCE_KEY=MetaData:Host&lt;/CODE&gt; makes the REGEX operator work only on the &lt;CODE&gt;host&lt;/CODE&gt; fied. &lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2011 16:10:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Rewrite-hostname-don-t-work/m-p/92191#M19152</guid>
      <dc:creator>_d_</dc:creator>
      <dc:date>2011-10-14T16:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Rewrite hostname don't work</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Rewrite-hostname-don-t-work/m-p/92192#M19153</link>
      <description>&lt;P&gt;You might have a conflict with the [syslog-host] rule in $SPLUNK_HOME/etc/system/default/transforms.conf, which is called by props.conf as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslog]
....
TRANSFORMS = syslog-host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Maybe your rule is evaluated first, but then its results are overwritten by the default one.&lt;BR /&gt;
You could try to force an order as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslog]
...
TRANSFORMS = 
TRANSFORMS-zz_fix_host = syslog-host, syslog_add_fqdn
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Have you inspected your runtime configurations with btool?&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;splunk btool --debug props list&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;Other than that, I recall the "-" when used in character classes should be either escaped or at the end of the class itself, otherwise it means a range.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslog_add_fqdn]
REGEX = host::([A-Za-z][\w\-]*[A-Za-z0-9])$
FORMAT = host::$1.domain.local
DEST_KEY = MetaData:Host
SOURCE_KEY = MetaData:Host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The write_meta should not be necessary in this case.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Oct 2011 11:07:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Rewrite-hostname-don-t-work/m-p/92192#M19153</guid>
      <dc:creator>Paolo_Prigione</dc:creator>
      <dc:date>2011-10-15T11:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rewrite hostname don't work</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Rewrite-hostname-don-t-work/m-p/92193#M19154</link>
      <description>&lt;P&gt;I'll check asap&lt;BR /&gt;
Grazie Paolo &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2011 18:32:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Rewrite-hostname-don-t-work/m-p/92193#M19154</guid>
      <dc:creator>bizza</dc:creator>
      <dc:date>2011-10-18T18:32:15Z</dc:date>
    </item>
  </channel>
</rss>

