<?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: Source Transform Replace '/' with '_' in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Source-Transform-Replace-with/m-p/209273#M41227</link>
    <description>&lt;P&gt;First - exactly what are you trying to do? Your transformation appears to attempt to manipulate both the source and the raw data.&lt;/P&gt;

&lt;P&gt;If you are trying to change the actual &lt;STRONG&gt;source&lt;/STRONG&gt; field for an event: there is no way to search-and-replace within the source field at indexing time.&lt;/P&gt;

&lt;P&gt;If you are trying to change the characters in a file name that appears within the &lt;STRONG&gt;raw data&lt;/STRONG&gt; of an event: you can do this. The rest of this answer explains how:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mysource]
DATETIME_CONFIG = CURRENT
category = Custom
pulldown_type = 1
CHARSET = AUTO
SEDCMD-abc = y/\/\:/__/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For more information about the SEDCMD, take a look at the &lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.1/Data/Anonymizedata#Substitute_characters"&gt;Anonymize Data&lt;/A&gt; page in the documentation.&lt;/P&gt;</description>
    <pubDate>Wed, 28 Dec 2016 21:52:25 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2016-12-28T21:52:25Z</dc:date>
    <item>
      <title>Source Transform Replace '/' with '_'</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Source-Transform-Replace-with/m-p/209272#M41226</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I created props and transforms files to put source value of file in raw event. I am sending these event to third party app. I am using heavy forwarder. But ı need to replace "/",":"(non-alphanumeric)  with "_" . Is there any way to replace char in source field with transforms.conf ?  I saw CLEAN_KEYS but this attribute is only valid for search-time field extractions.&lt;/P&gt;

&lt;P&gt;Props:&lt;BR /&gt;
[mysource]&lt;BR /&gt;
DATETIME_CONFIG = CURRENT&lt;BR /&gt;
category = Custom&lt;BR /&gt;
pulldown_type = 1&lt;BR /&gt;
TRANSFORMS-EYI_Transform = e_source&lt;BR /&gt;
CHARSET = AUTO&lt;/P&gt;

&lt;P&gt;[e_source]&lt;BR /&gt;
SOURCE_KEY = MetaData:Source&lt;BR /&gt;
REGEX = ^source::(.*)$&lt;BR /&gt;
FORMAT = filepath$1filepath$0&lt;BR /&gt;
DEST_KEY = _raw&lt;/P&gt;

&lt;P&gt;Event look like : &lt;BR /&gt;
&lt;STRONG&gt;filepathD:\inetpub\LocalUser\MYFILE.TXTfilepath&lt;/STRONG&gt;&amp;#2;&amp;#2;\xE1\xEC\xEB\x8C\x00&amp;#28;\x00\x8C\x00\x00&amp;#28;30.09.201601.01.0001x  \x00&amp;#28;NNYNNSAYX    SAYX    2016-12-06-11.29.05.4154172016-12-06-13.09.42.541869\x00&amp;#28;\x00\x00&amp;#12;&lt;/P&gt;

&lt;P&gt;Event should look like : &lt;BR /&gt;
&lt;STRONG&gt;filepathD__inetpub_LocalUser_MYFILE.TXTfilepath&lt;/STRONG&gt;&amp;#2;&amp;#2;\xE1\xEC\xEB\x8C\x00&amp;#28;\x00\x8C\x00\x00&amp;#28;30.09.201601.01.0001x  \x00&amp;#28;NNYNNSAYX    SAYX    2016-12-06-11.29.05.4154172016-12-06-13.09.42.541869\x00&amp;#28;\x00\x00&amp;#12;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:13:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Source-Transform-Replace-with/m-p/209272#M41226</guid>
      <dc:creator>ekremikizoglu</dc:creator>
      <dc:date>2020-09-29T12:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Source Transform Replace '/' with '_'</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Source-Transform-Replace-with/m-p/209273#M41227</link>
      <description>&lt;P&gt;First - exactly what are you trying to do? Your transformation appears to attempt to manipulate both the source and the raw data.&lt;/P&gt;

&lt;P&gt;If you are trying to change the actual &lt;STRONG&gt;source&lt;/STRONG&gt; field for an event: there is no way to search-and-replace within the source field at indexing time.&lt;/P&gt;

&lt;P&gt;If you are trying to change the characters in a file name that appears within the &lt;STRONG&gt;raw data&lt;/STRONG&gt; of an event: you can do this. The rest of this answer explains how:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mysource]
DATETIME_CONFIG = CURRENT
category = Custom
pulldown_type = 1
CHARSET = AUTO
SEDCMD-abc = y/\/\:/__/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For more information about the SEDCMD, take a look at the &lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.1/Data/Anonymizedata#Substitute_characters"&gt;Anonymize Data&lt;/A&gt; page in the documentation.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2016 21:52:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Source-Transform-Replace-with/m-p/209273#M41227</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2016-12-28T21:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Source Transform Replace '/' with '_'</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Source-Transform-Replace-with/m-p/209274#M41228</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;thanks for your reply. I am sending these logs to 3rd application. So It does not know about data's file name. So I added source field to raw data to understand which file's data is.  &lt;/P&gt;

&lt;P&gt;I think your setting transforms all raw data . But i want to manupulate just part of raw data which is filename area.&lt;/P&gt;

&lt;P&gt;Event look like : &lt;BR /&gt;
&lt;STRONG&gt;filepathD:\inetpub\LocalUser\MYFILE.TXTfilepath&lt;/STRONG&gt;&amp;#2;&amp;#2;rest of my raw data \0 bla bla:111&lt;/P&gt;

&lt;P&gt;Event should look like : &lt;BR /&gt;
&lt;STRONG&gt;filepathD__inetpub_LocalUser_MYFILE.TXTfilepath&amp;#2;&amp;#2;&lt;/STRONG&gt;rest of my raw data \0 bla bla:111&lt;/P&gt;

&lt;P&gt;Event should &lt;STRONG&gt;not&lt;/STRONG&gt; look like : &lt;BR /&gt;
&lt;STRONG&gt;filepathD__inetpub_LocalUser_MYFILE.TXTfilepath&amp;#2;&amp;#2;&lt;/STRONG&gt;rest of my raw data _0 bla bla_111&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:13:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Source-Transform-Replace-with/m-p/209274#M41228</guid>
      <dc:creator>ekremikizoglu</dc:creator>
      <dc:date>2020-09-29T12:13:32Z</dc:date>
    </item>
  </channel>
</rss>

