WAF Custom Rule / Custom JSON Response - Variables

What is the name of the domain?

What is the issue you’re encountering

Need to include “RayId” within a WAF Custom Rule Custom JSON Response

What steps have you taken to resolve the issue?

I have researched documentation and cannot find any information on this. The RAY ID needs to be delivered with a block to be able to diagnose it.

What are the steps to reproduce the issue?

WAF → Custom Rule → Create Rule → Action (Block) → Response Type (Custom JSON). Cannot determine how to include the Ray Id in the JSON response.

I don’t think you can use tokens in Custom Reponses in the WAF, but you can in Custom Error Responses:

You may be able to configure the Expression to narrow the scope to responses likely triggered by that WAF rule.