<?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: Accessing metadata from the format option in transforms.conf in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Accessing-metadata-from-the-format-option-in-transforms-conf/m-p/63805#M12824</link>
    <description>&lt;P&gt;eper Splunk support, not possible&lt;/P&gt;</description>
    <pubDate>Thu, 08 Nov 2012 22:03:01 GMT</pubDate>
    <dc:creator>peter_gianusso</dc:creator>
    <dc:date>2012-11-08T22:03:01Z</dc:date>
    <item>
      <title>Accessing metadata from the format option in transforms.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Accessing-metadata-from-the-format-option-in-transforms-conf/m-p/63804#M12823</link>
      <description>&lt;P&gt;Functionally, here's what I am looking to do.&lt;BR /&gt;&lt;BR /&gt;
I want to take the host (NJROS1BVA0597), append the source type (VM88 or VM11) identified in the props.conf and then re-write that to the host field.&lt;BR /&gt;&lt;BR /&gt;
So if the log is CAPPM_UPDATEDB.log, at the end of this, NJROS1BVA0597VM11 would be written to the host field.&lt;/P&gt;

&lt;P&gt;My regex seems to be working In the format option, because the $0 gets me the original host name without a problem. &lt;BR /&gt;
 It's getting the source type to append to it, that is the problem.&lt;BR /&gt;&lt;BR /&gt;
My probably feeble attempt MetaData:Sourcetype does not work.  &lt;/P&gt;

&lt;P&gt;input.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor://\\njros1bva0597\d$\LogFiles\W3SVC1\]
disabled = 0
host = NJROS1BVA0597
index=imaging
whitelist = \.log$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::...\\CAPPM*.log] 
sourcetype = VM11

[source::...\\ex*.log] 
sourcetype = VM88

[VM88]
TRANSFORMS-hostname = rewrite_host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[rewrite_host]
SOURCE_KEY = MetaData:Host
REGEX = .*
DEST_KEY = MetaData:Host
FORMAT = $0MetaData:Sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Sep 2012 18:25:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Accessing-metadata-from-the-format-option-in-transforms-conf/m-p/63804#M12823</guid>
      <dc:creator>peter_gianusso</dc:creator>
      <dc:date>2012-09-18T18:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing metadata from the format option in transforms.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Accessing-metadata-from-the-format-option-in-transforms-conf/m-p/63805#M12824</link>
      <description>&lt;P&gt;eper Splunk support, not possible&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2012 22:03:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Accessing-metadata-from-the-format-option-in-transforms-conf/m-p/63805#M12824</guid>
      <dc:creator>peter_gianusso</dc:creator>
      <dc:date>2012-11-08T22:03:01Z</dc:date>
    </item>
  </channel>
</rss>

