<?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: transforms.conf and props.conf in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/transforms-conf-and-props-conf/m-p/32595#M6814</link>
    <description>&lt;P&gt;For &lt;CODE&gt;FORMAT&lt;/CODE&gt;, it should reference the number of the capture group in your regular expression (i.e., which set of parentheses are you looking in). You only need WRITE_META for index-time field extractions, which are usually best avoided. Similarly, you can just use &lt;CODE&gt;host&lt;/CODE&gt; here in SOURCE_KEY, since it will be a normal field at that point. Last, for your regex - either use &lt;CODE&gt;.*&lt;/CODE&gt; to match multiple characters, or just leave it out completely since you're already matching anywhere within the hostname.&lt;/P&gt;

&lt;P&gt;Try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#transforms.conf
[role]
SOURCE_KEY=host
REGEX=(App|Web|Doc)
FORMAT=role::$1

#props.conf:
[sourceone]
TRANSFORMS-role=role
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 28 Sep 2020 09:41:51 GMT</pubDate>
    <dc:creator>southeringtonp</dc:creator>
    <dc:date>2020-09-28T09:41:51Z</dc:date>
    <item>
      <title>transforms.conf and props.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transforms-conf-and-props-conf/m-p/32594#M6813</link>
      <description>&lt;P&gt;I am trying to extract some values from the Host field. For example, variations of host name being:&lt;BR /&gt;
labAppdev03, labWebdev01, labDocDev02. What I am trying to get is App, Web or Doc as a role field out of host name field.&lt;/P&gt;

&lt;P&gt;What I have so far:&lt;/P&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[role]
SOURCE_KEY=MetaData:Host
REGEX=host::*(App|Web|Doc)*
FORMAT=role::app
WRITE_META=true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sourceone]
TRANSFORMS-role=role
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jun 2011 14:39:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transforms-conf-and-props-conf/m-p/32594#M6813</guid>
      <dc:creator>fi5033</dc:creator>
      <dc:date>2011-06-22T14:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: transforms.conf and props.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transforms-conf-and-props-conf/m-p/32595#M6814</link>
      <description>&lt;P&gt;For &lt;CODE&gt;FORMAT&lt;/CODE&gt;, it should reference the number of the capture group in your regular expression (i.e., which set of parentheses are you looking in). You only need WRITE_META for index-time field extractions, which are usually best avoided. Similarly, you can just use &lt;CODE&gt;host&lt;/CODE&gt; here in SOURCE_KEY, since it will be a normal field at that point. Last, for your regex - either use &lt;CODE&gt;.*&lt;/CODE&gt; to match multiple characters, or just leave it out completely since you're already matching anywhere within the hostname.&lt;/P&gt;

&lt;P&gt;Try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#transforms.conf
[role]
SOURCE_KEY=host
REGEX=(App|Web|Doc)
FORMAT=role::$1

#props.conf:
[sourceone]
TRANSFORMS-role=role
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:41:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transforms-conf-and-props-conf/m-p/32595#M6814</guid>
      <dc:creator>southeringtonp</dc:creator>
      <dc:date>2020-09-28T09:41:51Z</dc:date>
    </item>
  </channel>
</rss>

