Capturing the HTTP Status Code from the CA API Gateway Audit Sink Policy
search cancel

Capturing the HTTP Status Code from the CA API Gateway Audit Sink Policy

book

Article ID: 124966

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

Is there a way to capture what HTTP status code is being returned to the client, from the Audit Sink Policy, if the status code was set by either the Return Template Response to Requestor or Customize Error Response Assertions?

With the Customize Error Response assertion, the returned status in the audit events is 0. This is the default behavior.

Environment

All supported versions of the API Gateway

Resolution

USE CASE: There is a Return Template Response that is set for status code 600. When a service fails, a 600 HTTP status code is returned. The returned 600 HTTP status needs to be captured.

Attached are instructions on how to configure the gateway to capture specific error codes and write them to a custom log sink (using the audit sink policy).

Attachments

Log_HTTP_Response_Codes.zip get_app