How to encrypt the following data in Cribl

_raw: “customer_name”: “J Smith”,“customer_address”: “London Bridge London City”,“customer_phone”: “078758888888”,“card_number”: “4058 6182 1898 9041”,“card_type”: “visa”,“card_expiration”: “9/2022”,“card_cvv”: "858"Show less
and the followinf Mask is used

Match Regex —> (customer_name:)(\w+) Replace Expression ${g1}${C.Crypto.encrypt(g1,0)} does not seem to work.

I’m not sure your regex is correct. You have quoted values in your data, but the regex you have doesn’t match this pattern.

I would try something like this for your match regex:


and your replacement:


Excellent, I made the change all work well