<?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: transforms.conf and props.conf for replacing/substituing values in data that we are indexing in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-and-props-conf-for-replacing-substituing-values/m-p/444509#M77386</link>
    <description>&lt;P&gt;If you really need to do it like this, I guess you need to change the REGEX and FORMAT parts, such that the REGEX matches the full raw event, captures the bits that you want to keep and then in FORMAT refer to the capture groups to keep the rest of the event.&lt;/P&gt;

&lt;P&gt;But I'm not 100% sure how this exactly works with csv indexed_extractions and somehow with this sample data you shared it does not make too much sense that this config does anything (since Ignore is not actually at the start of the event).&lt;/P&gt;

&lt;P&gt;But in general, it would work something like this in transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[replacement]
REGEX = (.*?)Ignore(.*)
FORMAT = $1deferred$2
DEST_KEY = _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See also: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Data/Anonymizedata"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Data/Anonymizedata&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jul 2019 07:40:56 GMT</pubDate>
    <dc:creator>FrankVl</dc:creator>
    <dc:date>2019-07-04T07:40:56Z</dc:date>
    <item>
      <title>transforms.conf and props.conf for replacing/substituing values in data that we are indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-and-props-conf-for-replacing-substituing-values/m-p/444504#M77381</link>
      <description>&lt;P&gt;I want to replace/substitute the string value in the raw data with new string value. I have successfully done the substitution using props.conf (SED-cmd)&lt;/P&gt;

&lt;P&gt;But now I need to do the same with transforms.conf&lt;/P&gt;

&lt;P&gt;Scenario:&lt;/P&gt;

&lt;P&gt;Date,filedsA&lt;BR /&gt;
19-Jun,Ignore&lt;BR /&gt;
19-Jun,Ignore&lt;BR /&gt;
19-Jun,Ignore&lt;BR /&gt;
19-Jun,ABC&lt;BR /&gt;
19-Jun,DEF&lt;/P&gt;

&lt;P&gt;From the above data, I need to replace/substitute "Ignore" with "Deferred"&lt;/P&gt;

&lt;P&gt;So far, my transform.conf looks like this:&lt;/P&gt;

&lt;P&gt;[replacement]&lt;BR /&gt;
REGEX = ^Ignore&lt;BR /&gt;
FORMAT = deferred&lt;BR /&gt;
DEST_KEY = _raw&lt;/P&gt;

&lt;P&gt;Props.conf&lt;BR /&gt;
[replacement1]&lt;BR /&gt;
TRANSFORMS-replace = replacement&lt;BR /&gt;
BREAK_ONLY_BEFORE_DATE = &lt;BR /&gt;
DATETIME_CONFIG = &lt;BR /&gt;
INDEXED_EXTRACTIONS = csv&lt;BR /&gt;
KV_MODE = none&lt;BR /&gt;
LINE_BREAKER = ([\r\n]+)&lt;BR /&gt;
NO_BINARY_CHECK = true&lt;BR /&gt;
SHOULD_LINEMERGE = false&lt;BR /&gt;
category = Structured&lt;BR /&gt;
description = Comma-separated value format. Set header and other settings in "Delimited Settings"&lt;BR /&gt;
disabled = false&lt;BR /&gt;
pulldown_type = true&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:04:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-and-props-conf-for-replacing-substituing-values/m-p/444504#M77381</guid>
      <dc:creator>simon21</dc:creator>
      <dc:date>2020-09-30T01:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: transforms.conf and props.conf for replacing/substituing values in data that we are indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-and-props-conf-for-replacing-substituing-values/m-p/444505#M77382</link>
      <description>&lt;P&gt;And what exactly is your question / problem? I guess this overwrites your entire raw event with just "deferred", which is not what you want?&lt;/P&gt;

&lt;P&gt;Is that sample data your full raw events or only part of it? Does this replacement have to be done at index time? If so, why does SED not work? If not, why not simply do this with a LOOKUP or EVAL?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2019 12:51:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-and-props-conf-for-replacing-substituing-values/m-p/444505#M77382</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-06-28T12:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: transforms.conf and props.conf for replacing/substituing values in data that we are indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-and-props-conf-for-replacing-substituing-values/m-p/444506#M77383</link>
      <description>&lt;P&gt;The problem is the stanza header in props.conf should be &lt;CODE&gt;[&amp;lt;YourSourcetypeHere&amp;gt;]&lt;/CODE&gt; but in any case, don't do it like that; use &lt;CODE&gt;SEDCMD&lt;/CODE&gt; like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[&amp;lt;YourSourcetypeHere&amp;gt;]
SEDCMD-replace_ignore_with_deferred = s/Ignore/deferred/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But even more, it is poor form to modify your data this way, because it gives auditors the impression that this is the way the data really originated/always-was.  It would be better to use a lookup &lt;CODE&gt;YourLookupHere.csv&lt;/CODE&gt; that has data like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;oldFieldA,newFieldA
Ignore,disabled
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then use it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your Spl Here ... | lookup YourLookupHere.csc fieldA OUTPUT oldFieldA AS fieldA OUTPUT newFieldA AS fieldA
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 29 Jun 2019 14:51:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-and-props-conf-for-replacing-substituing-values/m-p/444506#M77383</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-06-29T14:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: transforms.conf and props.conf for replacing/substituing values in data that we are indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-and-props-conf-for-replacing-substituing-values/m-p/444507#M77384</link>
      <description>&lt;P&gt;I do not wish to use SPL. Also, tried and successfully tested using props.conf (SEDCMD). But I particularity need to use the transforms.conf and props.conf to replace/substitute the values. &lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 06:51:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-and-props-conf-for-replacing-substituing-values/m-p/444507#M77384</guid>
      <dc:creator>simon21</dc:creator>
      <dc:date>2019-07-04T06:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: transforms.conf and props.conf for replacing/substituing values in data that we are indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-and-props-conf-for-replacing-substituing-values/m-p/444508#M77385</link>
      <description>&lt;P&gt;Yes, it indeed replaCes the entire event. This is my entire sample data. Replacement needs to e done at index time. SED did work, but we particularly need to make it work using transforms.conf&lt;/P&gt;

&lt;P&gt;Need it to happen via the conf files only. Hence not looking at lookup option or the eval SPL options.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 06:53:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-and-props-conf-for-replacing-substituing-values/m-p/444508#M77385</guid>
      <dc:creator>simon21</dc:creator>
      <dc:date>2019-07-04T06:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: transforms.conf and props.conf for replacing/substituing values in data that we are indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-and-props-conf-for-replacing-substituing-values/m-p/444509#M77386</link>
      <description>&lt;P&gt;If you really need to do it like this, I guess you need to change the REGEX and FORMAT parts, such that the REGEX matches the full raw event, captures the bits that you want to keep and then in FORMAT refer to the capture groups to keep the rest of the event.&lt;/P&gt;

&lt;P&gt;But I'm not 100% sure how this exactly works with csv indexed_extractions and somehow with this sample data you shared it does not make too much sense that this config does anything (since Ignore is not actually at the start of the event).&lt;/P&gt;

&lt;P&gt;But in general, it would work something like this in transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[replacement]
REGEX = (.*?)Ignore(.*)
FORMAT = $1deferred$2
DEST_KEY = _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See also: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Data/Anonymizedata"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Data/Anonymizedata&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 07:40:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-and-props-conf-for-replacing-substituing-values/m-p/444509#M77386</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-07-04T07:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: transforms.conf and props.conf for replacing/substituing values in data that we are indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-and-props-conf-for-replacing-substituing-values/m-p/444510#M77387</link>
      <description>&lt;P&gt;Why? It is far more complicated.  It sound like you need an answer for a test.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 14:24:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-and-props-conf-for-replacing-substituing-values/m-p/444510#M77387</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-04T14:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: transforms.conf and props.conf for replacing/substituing values in data that we are indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-and-props-conf-for-replacing-substituing-values/m-p/444511#M77388</link>
      <description>&lt;P&gt;Did you notice that at the start of this answer I also told you what is wrong with your original attempt?&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jul 2019 01:25:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/transforms-conf-and-props-conf-for-replacing-substituing-values/m-p/444511#M77388</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-06T01:25:08Z</dc:date>
    </item>
  </channel>
</rss>

