<?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: Rex command: Help with regex to extract fields containing credit card numbers in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-Help-with-regex-to-extract-fields-containing-credit/m-p/178407#M51313</link>
    <description>&lt;P&gt;Thats great. Alternatively you could use | rex field=kreditnakatica mode=sed "s/(\d{12})/XXXXXXXXXXXX/g"&lt;/P&gt;</description>
    <pubDate>Tue, 12 Aug 2014 12:45:31 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2014-08-12T12:45:31Z</dc:date>
    <item>
      <title>Rex command: Help with regex to extract fields containing credit card numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-Help-with-regex-to-extract-fields-containing-credit/m-p/178403#M51309</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;I have a problem with splunk search. What I need to do is to do a search from the fields containing CC numbers. I have tried the example from the Splunk tutorial:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=ccnumber mode=sed "s/(\d{4}-){3}/XXXX-XXXX-XXXX-/g"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And I modified it as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=kreditnakatica mode=sed "s/(\d{4}){3}/XXXXXXXXXXXX/g"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As to accommodate my field name and the CC format with no hyphens, but it does not work. Overall, I seem to have a problem understanding what kind of regex would Splunk accept, as e.g. it does not accept regexes such as &lt;CODE&gt;\d{16}&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Thank you and cheers!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Aug 2014 20:48:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-Help-with-regex-to-extract-fields-containing-credit/m-p/178403#M51309</guid>
      <dc:creator>skansi</dc:creator>
      <dc:date>2014-08-11T20:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Rex command: Help with regex to extract fields containing credit card numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-Help-with-regex-to-extract-fields-containing-credit/m-p/178404#M51310</link>
      <description>&lt;P&gt;Are you trying to anonymize the credit card number? Do you need simple extraction or you need to anonymize the data?&lt;/P&gt;

&lt;P&gt;Can you post your log event.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2014 10:29:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-Help-with-regex-to-extract-fields-containing-credit/m-p/178404#M51310</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2014-08-12T10:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: Rex command: Help with regex to extract fields containing credit card numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-Help-with-regex-to-extract-fields-containing-credit/m-p/178405#M51311</link>
      <description>&lt;P&gt;Hi, I managed to solve the problem by circumventing it--just used Python to produce the xxxx-xxxx-xxxx-xxxx CC numbers and then applied the upper code. &lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2014 12:26:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-Help-with-regex-to-extract-fields-containing-credit/m-p/178405#M51311</guid>
      <dc:creator>skansi</dc:creator>
      <dc:date>2014-08-12T12:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Rex command: Help with regex to extract fields containing credit card numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-Help-with-regex-to-extract-fields-containing-credit/m-p/178406#M51312</link>
      <description>&lt;P&gt;Hi, I needed to anonymize the data. It works with the xxxx-xxxx-xxxx-xxxx CC format, and the example from the tutorial works fine, but fot the xxxxxxxxxxxxx format I am not able to modify the example. My solution was to modify the log to have an xxxx-...-xxxx format input and then use the out-of-the-box Splunk tutorial example.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2014 12:29:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-Help-with-regex-to-extract-fields-containing-credit/m-p/178406#M51312</guid>
      <dc:creator>skansi</dc:creator>
      <dc:date>2014-08-12T12:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: Rex command: Help with regex to extract fields containing credit card numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-command-Help-with-regex-to-extract-fields-containing-credit/m-p/178407#M51313</link>
      <description>&lt;P&gt;Thats great. Alternatively you could use | rex field=kreditnakatica mode=sed "s/(\d{12})/XXXXXXXXXXXX/g"&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2014 12:45:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-command-Help-with-regex-to-extract-fields-containing-credit/m-p/178407#M51313</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-08-12T12:45:31Z</dc:date>
    </item>
  </channel>
</rss>

