QuestionQ44

VerifiedManipulating Raw Data

The following sample log event indicates that credit card numbers are present in the transactions.log file.

2020-09-10 11:19:00 action=new_transaction cc_num=4556723486763517 value=2.55 ccy=GBP  

Which SEDCMD setting masks this and other suspected credit card numbers with an x for every character masked? The indexed event must be formatted as follows:

Masked version:

2020-09-10 11:19:00 action=new_transaction cc_num=4556723xxxxxxxxx value=2.55 ccy=GBP  
Explanation

A SEDCMD replacement can use a PCRE capture group and a \1 backreference. The expression in A preserves cc_num= and the first seven digits, while matching the following nine digits and replacing them with nine x characters. The global flag applies the replacement to every matching occurrence.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!