Forum Discussion
yakai
Oct 02, 2024Cirrus
Hello,
I believe that this use case can be done with irules.
You will need to identify a pattern, search for this pattern in your response page, and then replace the the response with only last for digits.
This irule ma
when HTTP_RESPONSE {
set response_data [HTTP::response]
# Regex to match the email pattern
set pattern {([a-zA-Z0-9._%+-]+)@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})}
# Replace the matched email with asterisks and keep the last four characters of the email
regsub -all $pattern $response_data {****@\$2} masked_response
# Replace the original response with the masked one
HTTP::response replace 0 [HTTP::header Content-Length] $masked_response
}
regards