<?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: SEDCMD regular expression question in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469587#M132138</link>
    <description>&lt;P&gt;Thank you! That seemed to partially work. It's masking it in some places.&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://i.postimg.cc/GhPtcGfX/Screen-Shot-2019-12-24-at-9-52-21-AM.png" alt="alt text" /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Dec 2019 16:54:49 GMT</pubDate>
    <dc:creator>adamfrisbee</dc:creator>
    <dc:date>2019-12-24T16:54:49Z</dc:date>
    <item>
      <title>SEDCMD regular expression question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469585#M132136</link>
      <description>&lt;P&gt;Okay you regexperts, I need some help. I have a .csv file for which I need to mask the credit card numbers. Here is what it looks like (with all fake data and cc number)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;user,first_name,last_name,email,cc_type,cc_no
bfiltness0,Bria,Filtness,bfiltness0@sayntec.com,jcb,3543149367325423
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've been trying to build my own regex expression, but with no luck. I would just like to replace the credit card number with xxxx. Any help would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 16:00:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469585#M132136</guid>
      <dc:creator>adamfrisbee</dc:creator>
      <dc:date>2019-12-24T16:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD regular expression question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469586#M132137</link>
      <description>&lt;P&gt;Try this sedcmd in your props under your sourcetype, or you could also specify it by host or source. This will take the 16 digit number and replace it with xxx.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-cc_replacement = s/\,(\d{16})/xxx/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&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>Tue, 24 Dec 2019 16:11:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469586#M132137</guid>
      <dc:creator>oscar84x</dc:creator>
      <dc:date>2019-12-24T16:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD regular expression question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469587#M132138</link>
      <description>&lt;P&gt;Thank you! That seemed to partially work. It's masking it in some places.&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://i.postimg.cc/GhPtcGfX/Screen-Shot-2019-12-24-at-9-52-21-AM.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 16:54:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469587#M132138</guid>
      <dc:creator>adamfrisbee</dc:creator>
      <dc:date>2019-12-24T16:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD regular expression question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469588#M132139</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[csv]
SEDCMD-YourSourcetypeHere_obscure_CCs = s/\d+$/x{4}/g
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Dec 2019 17:26:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469588#M132139</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-24T17:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD regular expression question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469589#M132140</link>
      <description>&lt;P&gt;Yours drops the last comma.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 17:28:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469589#M132140</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-24T17:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD regular expression question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469590#M132141</link>
      <description>&lt;P&gt;Neither of these mask the data, though. I must be doing something wrong. This is my props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[csv]
SEDCMD-mask = s/\d+$/x{4}/g
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Dec 2019 19:57:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469590#M132141</guid>
      <dc:creator>adamfrisbee</dc:creator>
      <dc:date>2019-12-24T19:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD regular expression question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469591#M132142</link>
      <description>&lt;P&gt;If you are sure that your settings are correct, it must be something else.  If you are doing a sourcetype override/overwrite, you must use the &lt;EM&gt;ORIGINAL&lt;/EM&gt; value, &lt;EM&gt;NOT&lt;/EM&gt; the new value.  You must deploy your settings to the first full instance(s) of Splunk that handle the events (usually either the HF tier if you use one, or else your Indexer tier) UNLESS you are using HEC's JSON endpoint (it gets pre-cooked) or INDEXED_EXTRACTIONS (configs go on the UF in that case), then restart all Splunk instances there.  When (re)evaluating, you must send in new events (old events will stay broken), then test using &lt;CODE&gt;_index_earliest=-5m&lt;/CODE&gt; to be absolutely certain that you are only examining the newly indexed events.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:26:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469591#M132142</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-09-30T03:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD regular expression question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469592#M132143</link>
      <description>&lt;P&gt;It seems to be masking it when I look at the raw data, but I can still, for example, do &lt;CODE&gt;| table cc_no&lt;/CODE&gt; and display all the CC numbers. &lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 21:02:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469592#M132143</guid>
      <dc:creator>adamfrisbee</dc:creator>
      <dc:date>2019-12-24T21:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD regular expression question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469593#M132144</link>
      <description>&lt;P&gt;If your credit card is not define with 16 number. You can try replace:&lt;BR /&gt;
&lt;CODE&gt;SEDCMD-cc_replacement = s/\,(\d{16})/xxxx/g&lt;/CODE&gt;&lt;BR /&gt;
to&lt;BR /&gt;
&lt;CODE&gt;SEDCMD-cc_replacement = s/\,(\d+)/\,xxxx/g&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;follow oscar84x said&lt;/P&gt;</description>
      <pubDate>Wed, 25 Dec 2019 02:52:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469593#M132144</guid>
      <dc:creator>outis</dc:creator>
      <dc:date>2019-12-25T02:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD regular expression question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469594#M132145</link>
      <description>&lt;P&gt;Hi @woodcock,&lt;/P&gt;

&lt;P&gt;I have verified that the the data coming in is hitting a HF first, then forwarding to a search head. When the data gets to the search head, I can see that it's replacing the cc number in the raw event (when I "show source" it does not show the cc number). However, cc_no still shows up as a field with populated values. In the images below, I've replaced the cc number with the string "secret" using your recommended sed. The first image is the raw data. &lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://i.postimg.cc/fTYY02qs/Screen-Shot-2019-12-26-at-7-23-05-PM.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://i.postimg.cc/VsCC3Z8t/Screen-Shot-2019-12-26-at-7-23-26-PM.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2019 02:27:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469594#M132145</guid>
      <dc:creator>adamfrisbee</dc:creator>
      <dc:date>2019-12-27T02:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: SEDCMD regular expression question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469595#M132146</link>
      <description>&lt;P&gt;Okay, I didn't have the inputs.conf stanza configured correctly. Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2019 16:28:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SEDCMD-regular-expression-question/m-p/469595#M132146</guid>
      <dc:creator>adamfrisbee</dc:creator>
      <dc:date>2019-12-27T16:28:40Z</dc:date>
    </item>
  </channel>
</rss>

