<?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: Need SEDCMD Help. in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Need-SEDCMD-Help/m-p/409996#M72692</link>
    <description>&lt;P&gt;To fix first problem to not replace last values we can use &lt;CODE&gt;SEDCMD-abc=s/^((?:[^,]*[,]){8})(?:[^,]*)/\1XXXX/&lt;/CODE&gt; (Removed &lt;CODE&gt;g&lt;/CODE&gt; ) but looks like you are using &lt;CODE&gt;INDEXED_EXTRACTIONS = csv&lt;/CODE&gt; or &lt;CODE&gt;sourcetype = csv&lt;/CODE&gt; and due to that only _raw data modifies but not indexed fields.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Apr 2019 20:45:55 GMT</pubDate>
    <dc:creator>harsmarvania57</dc:creator>
    <dc:date>2019-04-17T20:45:55Z</dc:date>
    <item>
      <title>Need SEDCMD Help.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Need-SEDCMD-Help/m-p/409993#M72689</link>
      <description>&lt;P&gt;I have a csv that is coming in and we want to replace anything in the name section with "XXXX"&lt;/P&gt;

&lt;P&gt;Sample events&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"2019-04-16 15:02:42",,22290412_163115_00725.pdf,111111,,,,,--------Please Select Member --------, 0000, 000,AlertID-000000,AlertID-000000,AlertID-000000,Success,"Get New File",1,Prod,UserName,COMPANYNAME,WSH4109162,Pega Robotics,8.0.2009,CareAlerts Provider Feedback,1.38,

"2019-04-17 11:43:15",123470044,20190415_115516_00257.pdf,4000146,Provider,123612,General Feedback  ,   123456789,Jane  L  Doe    , 0000, 000,123758-100000,123233-100000,AlertID-000000,Failed,"General Feedback : AlertID not found or not enabled.",13,Prod,username,CompanyName,WSWH4051106,Pega Robotics,8.0.2009,CareAlerts Provider Feedback,1.38,
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So in these events the following strings should be replaced with XXXX&lt;/P&gt;

&lt;P&gt;--------Please Select Member --------&lt;BR /&gt;
Jane  L  Doe&lt;/P&gt;

&lt;P&gt;I've gotten this extraction from Splunk for the field, but it does not work in SEDCMD.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-CSV1 = s/(?ms)^(?:[^,\\n]*,){8}(?P&amp;lt;MemberTest&amp;gt;[^,]+)/XXXX/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;_______________________Edit, to insert image -----------------------------&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/6882iD3F4608A9482BDDD/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 15:57:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Need-SEDCMD-Help/m-p/409993#M72689</guid>
      <dc:creator>JDukeSplunk</dc:creator>
      <dc:date>2019-04-17T15:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need SEDCMD Help.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Need-SEDCMD-Help/m-p/409994#M72690</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Please try below config.&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetype]
SEDCMD-abc=s/^((?:[^,]*[,]){8})(?:[^,]*)/\1XXXX/g
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Apr 2019 18:08:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Need-SEDCMD-Help/m-p/409994#M72690</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-04-17T18:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need SEDCMD Help.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Need-SEDCMD-Help/m-p/409995#M72691</link>
      <description>&lt;P&gt;I tried your string, and it sort of works but behaves weirdly..See the image I edited to the original question. &lt;/P&gt;

&lt;P&gt;It replaces the desired text in _raw, but the field value is still present for the data that was replaced with XXXX. &lt;BR /&gt;
Also, it replaces a second set of data 8 more commas down the line. &lt;/P&gt;

&lt;P&gt;The first highlighted XXXX with the red circle is what we wanted, the second we did not. Also, MemberName= clearly still shows the value of what is now XXXX. &lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 19:59:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Need-SEDCMD-Help/m-p/409995#M72691</guid>
      <dc:creator>JDukeSplunk</dc:creator>
      <dc:date>2019-04-17T19:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Need SEDCMD Help.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Need-SEDCMD-Help/m-p/409996#M72692</link>
      <description>&lt;P&gt;To fix first problem to not replace last values we can use &lt;CODE&gt;SEDCMD-abc=s/^((?:[^,]*[,]){8})(?:[^,]*)/\1XXXX/&lt;/CODE&gt; (Removed &lt;CODE&gt;g&lt;/CODE&gt; ) but looks like you are using &lt;CODE&gt;INDEXED_EXTRACTIONS = csv&lt;/CODE&gt; or &lt;CODE&gt;sourcetype = csv&lt;/CODE&gt; and due to that only _raw data modifies but not indexed fields.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 20:45:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Need-SEDCMD-Help/m-p/409996#M72692</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-04-17T20:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need SEDCMD Help.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Need-SEDCMD-Help/m-p/409997#M72693</link>
      <description>&lt;P&gt;In my lab environment I have tested below config on standalone splunk and it is masking data correctly (Raw data as well as Indexed Fields)&lt;/P&gt;

&lt;P&gt;props.conf (You might not require &lt;CODE&gt;INDEXED_EXTRACTIONS = CSV&lt;/CODE&gt; in below config on Splunk Enterprise if you set that on Universal Forwarder)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetype]
SEDCMD-abc=s/^((?:[^,]*[,]){8})(?:[^,]*)/\1XXXX/
INDEXED_EXTRACTIONS = CSV
TRANSFORMS-test = remove_member
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[remove_member]
REGEX = (?m)^(.*Member\:\:)(?:\"[^\"]*\"|[^\s]*)(\s.*)
FORMAT = $1XXXX$2
WRITE_META = false
SOURCE_KEY = _meta
DEST_KEY = _meta
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Based on Splunk Document, it is not recommend to use &lt;CODE&gt;DEST_KEY = _meta&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;If DEST_KEY = _meta (not recommended) you should also add $0 to the
    start of your FORMAT setting.  $0 represents the DEST_KEY value before
    Splunk software performs the REGEX (in other words, _meta).
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Apr 2019 11:55:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Need-SEDCMD-Help/m-p/409997#M72693</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-04-18T11:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need SEDCMD Help.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Need-SEDCMD-Help/m-p/409998#M72694</link>
      <description>&lt;P&gt;You have an extra &lt;CODE&gt;\\&lt;/CODE&gt; so try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-CSV1 = s/(?ms)^(?:[^,\n]*,){8}(?P&amp;lt;MemberTest&amp;gt;[^,]+)/XXXX/g
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Apr 2019 12:30:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Need-SEDCMD-Help/m-p/409998#M72694</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-18T12:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need SEDCMD Help.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Need-SEDCMD-Help/m-p/409999#M72695</link>
      <description>&lt;P&gt;Thanks for your help, but the [remove_member] is still not working as expected. &lt;/P&gt;

&lt;P&gt;I've applied this to the app on the UF  \etc\appname\local and to my indexers  (which should it be?) &lt;BR /&gt;
../splunk/etc/system/local props.conf and transforms.conf. The _raw gets redacted as expected by the extracted field "MemberName" still comes through with the original value.&lt;/P&gt;

&lt;P&gt;Is this because the replacement regex is (.*Member::)  not (.*MemberName::)?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:11:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Need-SEDCMD-Help/m-p/409999#M72695</guid>
      <dc:creator>JDukeSplunk</dc:creator>
      <dc:date>2020-09-30T00:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need SEDCMD Help.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Need-SEDCMD-Help/m-p/410000#M72696</link>
      <description>&lt;P&gt;Yes correct, I have taken fieldname as Member, in your case if it is MemberName then replace Member with MemberName in REGEX.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 17:42:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Need-SEDCMD-Help/m-p/410000#M72696</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-04-18T17:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Need SEDCMD Help.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Need-SEDCMD-Help/m-p/410001#M72697</link>
      <description>&lt;P&gt;Ok.. That got it. Thanks!&lt;/P&gt;

&lt;P&gt;To Summarize for posterity.&lt;BR /&gt;
Had to update from 6.5.2 to 7.2.3 for proper field extraction from the csv.&lt;/P&gt;

&lt;P&gt;Files located in /etc/appname/local on the UF deployed from the Deployment server. &lt;BR /&gt;
inputs.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor://E:\CareAlerts_Fax_Prod\Reporting\*csv$]
disabled = 0
sourcetype=cafax:prod
ignoreOlderThan = 30d
index = application
crcSalt = &amp;lt;SOURCE&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[cafax:prod]
DATETIME_CONFIG = 
INDEXED_EXTRACTIONS = csv
KV_MODE = none
LINE_BREAKER = ([\r\n]+)
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
category = Structured
description = Comma-separated value format. Set header and other settings in "Delimited Settings"
disabled = false
pulldown_type = true
SEDCMD-mname=s/^((?:[^,]*[,]){8})(?:[^,]*)/\1XX-REDACTED-XX/
TRANSFORMS-test = remove_membername
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [remove_membername]
 REGEX = (?m)^(.*MemberName\:\:)(?:\"[^\"]*\"|[^\s]*)(\s.*)
 FORMAT = $1XX-REDACTED-XX$2
 WRITE_META = false
 SOURCE_KEY = _meta
 DEST_KEY = _meta
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Apr 2019 18:28:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Need-SEDCMD-Help/m-p/410001#M72697</guid>
      <dc:creator>JDukeSplunk</dc:creator>
      <dc:date>2019-04-18T18:28:31Z</dc:date>
    </item>
  </channel>
</rss>

