<?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: Override source (tcp:xxxx) of a tcp input using transforms in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Override-source-tcp-xxxx-of-a-tcp-input-using-transforms/m-p/29651#M88682</link>
    <description>&lt;P&gt;Restart was definitively needed, that was clearly hampering the testing.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Aug 2010 22:09:54 GMT</pubDate>
    <dc:creator>parallaxed</dc:creator>
    <dc:date>2010-08-13T22:09:54Z</dc:date>
    <item>
      <title>Override source (tcp:xxxx) of a tcp input using transforms</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Override-source-tcp-xxxx-of-a-tcp-input-using-transforms/m-p/29649#M88680</link>
      <description>&lt;P&gt;Looks like MetaData:Source should be used, but despite many variations and | extract reload=t, I can't seem to get this to work, even by attempting to force it, as per below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;transforms.conf

[net_type]
DEST_KEY = MetaData:Source
REGEX = .*
FORMAT = source::VMSTAT
WRITE_META = true

props.conf 

[net]
SHOULD_LINEMERGE=false
TRANSFORMS-net_type = net_type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;^ Firstly, this "forcing" seems like  it should be valid - it may not be, please correct me.&lt;/P&gt;

&lt;P&gt;I'm looking to apply this depending on the raw text of the event, so my source type isn't fixed and can't be set in inputs.conf. &lt;/P&gt;

&lt;P&gt;Is source override possible for only certain types of inputs?&lt;/P&gt;

&lt;P&gt;I should add this is Splunk 4.1.x, and that this transformation works if I use MetaData:Sourcetype instead of MetaData:Source. Why would it work with one field but not the other?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Aug 2010 18:56:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Override-source-tcp-xxxx-of-a-tcp-input-using-transforms/m-p/29649#M88680</guid>
      <dc:creator>parallaxed</dc:creator>
      <dc:date>2010-08-13T18:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Override source (tcp:xxxx) of a tcp input using transforms</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Override-source-tcp-xxxx-of-a-tcp-input-using-transforms/m-p/29650#M88681</link>
      <description>&lt;P&gt;I believe this should work.  Please note that using &lt;CODE&gt;| extract reload=T&lt;/CODE&gt; &lt;STRONG&gt;will not&lt;/STRONG&gt; reload an index-time config like this, you will need to restart &lt;CODE&gt;splunkd&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;I would also suggest the following in &lt;CODE&gt;transforms.conf&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[net_type]
DEST_KEY = MetaData:Source
REGEX = .
FORMAT = source::VMSTAT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Two changes:  (1)  You don't need &lt;CODE&gt;WRITE_META&lt;/CODE&gt; in this case.   (2) No need use the more-expensive &lt;CODE&gt;.*&lt;/CODE&gt;, when a simple &lt;CODE&gt;.&lt;/CODE&gt; will do the trick.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Aug 2010 21:56:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Override-source-tcp-xxxx-of-a-tcp-input-using-transforms/m-p/29650#M88681</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-08-13T21:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Override source (tcp:xxxx) of a tcp input using transforms</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Override-source-tcp-xxxx-of-a-tcp-input-using-transforms/m-p/29651#M88682</link>
      <description>&lt;P&gt;Restart was definitively needed, that was clearly hampering the testing.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Aug 2010 22:09:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Override-source-tcp-xxxx-of-a-tcp-input-using-transforms/m-p/29651#M88682</guid>
      <dc:creator>parallaxed</dc:creator>
      <dc:date>2010-08-13T22:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Override source (tcp:xxxx) of a tcp input using transforms</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Override-source-tcp-xxxx-of-a-tcp-input-using-transforms/m-p/29652#M88683</link>
      <description>&lt;P&gt;I am reasonably sure that on your &lt;EM&gt;input&lt;/EM&gt; stanza, you can just specify:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[tcp:xxxx]
sourcetype = net_type
source = VMSTAT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This won't work on a &lt;CODE&gt;splunktcp:&lt;/CODE&gt; input, as that comes from a forwarder and the source would have been set on the forwarder, but for scripted, udp, and tcp inputs, you can just override it like this.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2010 23:19:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Override-source-tcp-xxxx-of-a-tcp-input-using-transforms/m-p/29652#M88683</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-08-18T23:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: Override source (tcp:xxxx) of a tcp input using transforms</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Override-source-tcp-xxxx-of-a-tcp-input-using-transforms/m-p/29653#M88684</link>
      <description>&lt;P&gt;A regex of &lt;CODE&gt;.&lt;/CODE&gt; or &lt;CODE&gt;.?&lt;/CODE&gt; seems better to me than &lt;CODE&gt;.*&lt;/CODE&gt;, although I don't know if PCRE optimizes this out if there is no capture group. I personally use &lt;CODE&gt;(?=)&lt;/CODE&gt; for a PCRE regex that always matches.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2010 23:23:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Override-source-tcp-xxxx-of-a-tcp-input-using-transforms/m-p/29653#M88684</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-08-18T23:23:17Z</dc:date>
    </item>
  </channel>
</rss>

