<?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: Applying changes to logs whose sourcetype has been changed on a per-event basis in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Applying-changes-to-logs-whose-sourcetype-has-been-changed-on-a/m-p/442874#M77149</link>
    <description>&lt;P&gt;Hi @koshyk, thanks for the reply. I'm not sure this will work in my case. I'm setting the sourcetype based on one string that is only common to those logs, however the string I need removed from the new sourcetype is common to the logs in both the new and old sourcetypes. The way this is written, I believe it will affect both of my sourcetypes, correct?&lt;/P&gt;</description>
    <pubDate>Wed, 08 May 2019 17:25:11 GMT</pubDate>
    <dc:creator>ehowardl3</dc:creator>
    <dc:date>2019-05-08T17:25:11Z</dc:date>
    <item>
      <title>Applying changes to logs whose sourcetype has been changed on a per-event basis</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Applying-changes-to-logs-whose-sourcetype-has-been-changed-on-a/m-p/442872#M77147</link>
      <description>&lt;P&gt;I have the need to change the sourcetype of certain logs on a per-event basis, then apply further changes on the new sourcetype in props.conf after the sourcetype change.  For example:&lt;/P&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [set_new_sourcetype]
 DEST_KEY = MetaData:Sourcetype
 REGEX = some_regex
 FORMAT = sourcetype::my:new:sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[old:sourcetype]
TRANSFORMS-sourcetype_change = set_new_sourcetype

[my:new:sourcetype]
SEDCMD-whatever = s/change/that/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, the SEDCMD does not work on the new sourcetype. If I move the SEDCMD to the original sourcetype it works. Is there a workaround for this? If not, what's the point of being able to change the sourcetype on a per-event basis if you can't do anything with it afterwards?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 14:12:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Applying-changes-to-logs-whose-sourcetype-has-been-changed-on-a/m-p/442872#M77147</guid>
      <dc:creator>ehowardl3</dc:creator>
      <dc:date>2019-05-08T14:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Applying changes to logs whose sourcetype has been changed on a per-event basis</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Applying-changes-to-logs-whose-sourcetype-has-been-changed-on-a/m-p/442873#M77148</link>
      <description>&lt;P&gt;Please have a try like&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[old:sourcetype]
TRANSFORMS-sourcetype_change = set_new_sourcetype,substitute_whatever
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[set_new_sourcetype]
 DEST_KEY = MetaData:Sourcetype
 REGEX = some_regex
 FORMAT = sourcetype::my:new:sourcetype

  [substitute_whatever]
  REGEX = (findSomeKey)
  FORMAT = substitutedValue
  DEST_KEY = _raw
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 May 2019 15:02:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Applying-changes-to-logs-whose-sourcetype-has-been-changed-on-a/m-p/442873#M77148</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-05-08T15:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Applying changes to logs whose sourcetype has been changed on a per-event basis</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Applying-changes-to-logs-whose-sourcetype-has-been-changed-on-a/m-p/442874#M77149</link>
      <description>&lt;P&gt;Hi @koshyk, thanks for the reply. I'm not sure this will work in my case. I'm setting the sourcetype based on one string that is only common to those logs, however the string I need removed from the new sourcetype is common to the logs in both the new and old sourcetypes. The way this is written, I believe it will affect both of my sourcetypes, correct?&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 17:25:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Applying-changes-to-logs-whose-sourcetype-has-been-changed-on-a/m-p/442874#M77149</guid>
      <dc:creator>ehowardl3</dc:creator>
      <dc:date>2019-05-08T17:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Applying changes to logs whose sourcetype has been changed on a per-event basis</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Applying-changes-to-logs-whose-sourcetype-has-been-changed-on-a/m-p/442875#M77150</link>
      <description>&lt;P&gt;That is correct. So you essentially need "almost duplicate" data in two sourcetypes.&lt;BR /&gt;
If that's the case, in the above logic, do as two lines.  Ensure that the TRANSFORM names are increasing order of ASCII . Something like below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [old:sourcetype]
 TRANSFORMS-1sourcetype_change = set_new_sourcetype
 TRANSFORMS-2substitute_whatever = substitute_whatever
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 May 2019 18:48:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Applying-changes-to-logs-whose-sourcetype-has-been-changed-on-a/m-p/442875#M77150</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-05-08T18:48:32Z</dc:date>
    </item>
  </channel>
</rss>

