<?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: Tranformations to set different sourcetypes based on fields in an event in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Tranformations-to-set-different-sourcetypes-based-on-fields-in/m-p/21354#M3167</link>
    <description>&lt;P&gt;I believe that your DEST_KEY value isn't valid....keys are case-sensitive and MetaData:Sourcetype is the correct value, not MetaData:SourceType&lt;/P&gt;

&lt;P&gt;From: $SPLUNK_HOME/etc/system/README/transforms.conf.spec&lt;/P&gt;

&lt;H1&gt;*******&lt;/H1&gt;

&lt;H1&gt;KEYS:&lt;/H1&gt;

&lt;H1&gt;*******&lt;/H1&gt;

&lt;UL&gt;
&lt;LI&gt;NOTE: Keys are case-sensitive. Use the following keys exactly as they appear.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;queue : Specify which queue to send the event to (can be parsingQueue, nullQueue, indexQueue).&lt;BR /&gt;
_raw  : The raw text of the event.&lt;BR /&gt;
_done : If set to any string, this represents the last event in a stream.&lt;BR /&gt;
_meta : A space-separated list of metadata for an event.&lt;BR /&gt;
_time : The timestamp of the event, in seconds since 1/1/1970 UTC.&lt;BR /&gt;
MetaData:FinalType  : The event type of the event.&lt;/P&gt;

&lt;P&gt;MetaData:Host       : The host associated with the event.&lt;BR /&gt;
                      The value must be prefixed by "host::"&lt;/P&gt;

&lt;P&gt;_MetaData:Index     : The index where the event should be stored.&lt;/P&gt;

&lt;P&gt;MetaData:Source     : The source associated with the event.&lt;BR /&gt;
                      The value must be prefixed by "source::"&lt;/P&gt;

&lt;P&gt;MetaData:Sourcetype : The sourcetype of the event.&lt;BR /&gt;
                      The value must be prefixed by "sourcetype::"&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jun 2011 05:51:48 GMT</pubDate>
    <dc:creator>cgilbert_splunk</dc:creator>
    <dc:date>2011-06-03T05:51:48Z</dc:date>
    <item>
      <title>Tranformations to set different sourcetypes based on fields in an event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Tranformations-to-set-different-sourcetypes-based-on-fields-in/m-p/21353#M3166</link>
      <description>&lt;P&gt;I am trying to change the sourcetype on the events from a dataset based on certain fields in the dataset that is currently being added using a scripted input. This is what I have currently:&lt;/P&gt;

&lt;H2&gt;props.conf&lt;/H2&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
[source::testservice]&lt;BR /&gt;
TRANSFORMS-changesourcetype = sourcetype-test1info, sourcetype-test2info&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;H2&gt;transforms.conf&lt;/H2&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
[sourcetype-test1info]&lt;BR /&gt;
DEST_KEY = MetaData:SourceType&lt;BR /&gt;
REGEX = "field1=(?&lt;FIELDVALUE&gt;[^ ]&lt;EM&gt;)"&lt;BR /&gt;
FORMAT = sourcetype::test1info&lt;BR /&gt;
CLEAN_KEYS = 0&lt;BR /&gt;
MV_ADD = 0&lt;BR /&gt;
&lt;/EM&gt;&lt;/FIELDVALUE&gt;&lt;/CODE&gt;&lt;EM&gt;&lt;BR /&gt;
&lt;CODE&gt; &lt;BR /&gt;
[sourcetype-test2info]&lt;BR /&gt;
DEST_KEY = MetaData:SourceType&lt;BR /&gt;
REGEX = "field2=(?&lt;FIELDVALUE&gt;[^ ]&lt;/FIELDVALUE&gt;&lt;/CODE&gt;&lt;/EM&gt;&lt;CODE&gt;)"&lt;BR /&gt;
FORMAT = sourcetype::test2info&lt;BR /&gt;
CLEAN_KEYS = 0&lt;BR /&gt;
MV_ADD = 0&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The files are currently located in etc/apps/appname/local. I dont see this transformation having any effect. The event would look something like:&lt;BR /&gt;
2011-06-01 20:41:13 PDT timestamp=1306986073 field1=value1 location=testlocation&lt;/P&gt;

&lt;P&gt;Any idea what I may be missing?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:38:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Tranformations-to-set-different-sourcetypes-based-on-fields-in/m-p/21353#M3166</guid>
      <dc:creator>pksudip</dc:creator>
      <dc:date>2020-09-28T09:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Tranformations to set different sourcetypes based on fields in an event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Tranformations-to-set-different-sourcetypes-based-on-fields-in/m-p/21354#M3167</link>
      <description>&lt;P&gt;I believe that your DEST_KEY value isn't valid....keys are case-sensitive and MetaData:Sourcetype is the correct value, not MetaData:SourceType&lt;/P&gt;

&lt;P&gt;From: $SPLUNK_HOME/etc/system/README/transforms.conf.spec&lt;/P&gt;

&lt;H1&gt;*******&lt;/H1&gt;

&lt;H1&gt;KEYS:&lt;/H1&gt;

&lt;H1&gt;*******&lt;/H1&gt;

&lt;UL&gt;
&lt;LI&gt;NOTE: Keys are case-sensitive. Use the following keys exactly as they appear.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;queue : Specify which queue to send the event to (can be parsingQueue, nullQueue, indexQueue).&lt;BR /&gt;
_raw  : The raw text of the event.&lt;BR /&gt;
_done : If set to any string, this represents the last event in a stream.&lt;BR /&gt;
_meta : A space-separated list of metadata for an event.&lt;BR /&gt;
_time : The timestamp of the event, in seconds since 1/1/1970 UTC.&lt;BR /&gt;
MetaData:FinalType  : The event type of the event.&lt;/P&gt;

&lt;P&gt;MetaData:Host       : The host associated with the event.&lt;BR /&gt;
                      The value must be prefixed by "host::"&lt;/P&gt;

&lt;P&gt;_MetaData:Index     : The index where the event should be stored.&lt;/P&gt;

&lt;P&gt;MetaData:Source     : The source associated with the event.&lt;BR /&gt;
                      The value must be prefixed by "source::"&lt;/P&gt;

&lt;P&gt;MetaData:Sourcetype : The sourcetype of the event.&lt;BR /&gt;
                      The value must be prefixed by "sourcetype::"&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2011 05:51:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Tranformations-to-set-different-sourcetypes-based-on-fields-in/m-p/21354#M3167</guid>
      <dc:creator>cgilbert_splunk</dc:creator>
      <dc:date>2011-06-03T05:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Tranformations to set different sourcetypes based on fields in an event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Tranformations-to-set-different-sourcetypes-based-on-fields-in/m-p/21355#M3168</link>
      <description>&lt;P&gt;That was the issue, after fixing that I also realized that the regex shouldn't be in double quotes. Thanks for the quick response!!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2011 17:30:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Tranformations-to-set-different-sourcetypes-based-on-fields-in/m-p/21355#M3168</guid>
      <dc:creator>pksudip</dc:creator>
      <dc:date>2011-06-03T17:30:08Z</dc:date>
    </item>
  </channel>
</rss>

