<?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 When changing host value using transforms.conf, how do I set the host value to something based on a regex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/When-changing-host-value-using-transforms-conf-how-do-I-set-the/m-p/395212#M174504</link>
    <description>&lt;P&gt;I'm very new to Splunk. I'm trying to use transforms.conf and props.conf to set the host value to something based on a regex. Every time I try it, the host value is always set to $1.&lt;/P&gt;

&lt;P&gt;This is my transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setHost]
DEST_KEY = MetaData:Host
SOURCE_KEY = MetaData:Source
REGEX = webserver\d{0,2}-\d{0,3}
FORMAT = host::"$1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is my props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[iis]
TRANSFORMS-setHost = setHost
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The source that it's coming from looks like this /var/logs/webserver01-003/blah.log&lt;/P&gt;

&lt;P&gt;How do I get this to work?&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Fri, 16 Nov 2018 14:08:44 GMT</pubDate>
    <dc:creator>dfetcher</dc:creator>
    <dc:date>2018-11-16T14:08:44Z</dc:date>
    <item>
      <title>When changing host value using transforms.conf, how do I set the host value to something based on a regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/When-changing-host-value-using-transforms-conf-how-do-I-set-the/m-p/395212#M174504</link>
      <description>&lt;P&gt;I'm very new to Splunk. I'm trying to use transforms.conf and props.conf to set the host value to something based on a regex. Every time I try it, the host value is always set to $1.&lt;/P&gt;

&lt;P&gt;This is my transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setHost]
DEST_KEY = MetaData:Host
SOURCE_KEY = MetaData:Source
REGEX = webserver\d{0,2}-\d{0,3}
FORMAT = host::"$1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is my props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[iis]
TRANSFORMS-setHost = setHost
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The source that it's coming from looks like this /var/logs/webserver01-003/blah.log&lt;/P&gt;

&lt;P&gt;How do I get this to work?&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 14:08:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/When-changing-host-value-using-transforms-conf-how-do-I-set-the/m-p/395212#M174504</guid>
      <dc:creator>dfetcher</dc:creator>
      <dc:date>2018-11-16T14:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: When changing host value using transforms.conf, how do I set the host value to something based on a regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/When-changing-host-value-using-transforms-conf-how-do-I-set-the/m-p/395213#M174505</link>
      <description>&lt;P&gt;Remove the double quotes around $1 in your FORMAT, and add a capturing group to your REGEX around whatever you want the host value to be. $1 refers to the first capturing group, without a capturing group there's nothing to refer to.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 17:12:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/When-changing-host-value-using-transforms-conf-how-do-I-set-the/m-p/395213#M174505</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2018-11-16T17:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: When changing host value using transforms.conf, how do I set the host value to something based on a regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/When-changing-host-value-using-transforms-conf-how-do-I-set-the/m-p/395214#M174506</link>
      <description>&lt;P&gt;Or much simpler: set &lt;CODE&gt;host_segment = 3&lt;/CODE&gt; in inputs.conf and you can forget about that whole TRANSFORMS stuff &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 17:24:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/When-changing-host-value-using-transforms-conf-how-do-I-set-the/m-p/395214#M174506</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-11-16T17:24:38Z</dc:date>
    </item>
  </channel>
</rss>

