QuestionQ65

VerifiedSPL and Efficient Searching

While testing the dynamic removal of credit card numbers, an analyst decides to use the rex command. Which mode must be set to replace the specified values with X?

| makeresults  
| eval ccnumber="511388720478619733"  
| rex field=ccnumber mode=??? "s/(\d\{4\}-)\{3)/XXXX-XXXX-XXXX-/g"  

Assume that the preceding rex command is written correctly.

Explanation

Splunk rex uses mode=sed to apply sed expressions. The s/<regex>/<replacement>/g form is a sed replacement expression, which replaces each matched value with the specified X-based masking string.

Learn more

Community Discussion

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