We have configured the API Gateway to send us an email when there are failures in requests. I would like the email to contain the failure info information we get in the "Associated Logs". Is there a way to do this?
Hi,
You can use the Email Alert Assertion but it will not allow you to Attach at logs or files to it.
You can add a context variable that you may have it predefined that is holding any Error codes which can be sent to you.
Hope this helps
Thanks
Abs
If you are doing the logic of sending an email in the policy not in a Audit sink policy then you can use some of the Audit Context Variables. (Audit Context Variables - CA API Gateway - 9.2 - CA Technologies Documentation) The one I've seen that works the best is the ${audit.details.last.fullText} as it will grab the error that occurred within the last assertion executed and will provide the information that you see in the Associated Logs.
Sincerely,
Stephen Hughes
Director, CA Support
Thanks for putting me on the right track. I used the audit context variable below and it seems to be working well.
${audit.details.2.fullText}
Please note that as you add assertions into the policy the ordinal of 2 may change depending on the positioning of the assertions.