Logging config for API Gateway JSON format with all variable included
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "accountId": "$context.accountId", "apiId": "$context.apiId", "authorizer.error": "$context.authorizer.error", "authorizer.principalId": "$context.authorizer.principalId", "authorizer.property": "$context.authorizer.property", "awsEndpointRequestId": "$context.awsEndpointRequestId", "awsEndpointRequestId2": "$context.awsEndpointRequestId2", "customDomain.basePathMatched": "$context.customDomain.basePathMatched", "dataProcessed": "$context.dataProcessed", "domainName": "$context.domainName", "domainPrefix": "$context.domainPrefix", "error.message": "$context.error.message", "error.messageString": "$context.error.messageString", "error.responseType": "$context.error.responseType", "extendedRequestId": "$context.extendedRequestId", "httpMethod": "$context.httpMethod", "identity.accountId": "$context.identity.accountId", "identity.caller": "$context.identity.caller", "identity.cognitoAuthenticationProvider": "$context.identity.cognitoAuthenticationProvider", "identity.cognitoAuthenticationType": "$context.identity.cognitoAuthenticationType", "identity.cognitoIdentityId": "$context.identity.cognitoIdentityId", "identity.cognitoIdentityPoolId": "$context.identity.cognitoIdentityPoolId", "identity.principalOrgId": "$context.identity.principalOrgId", "identity.clientCert.clientCertPem": "$context.identity.clientCert.clientCertPem", "identity.clientCert.subjectDN": "$context.identity.clientCert.subjectDN", "identity.clientCert.issuerDN": "$context.identity.clientCert.issuerDN", "identity.clientCert.serialNumber": "$context.identity.clientCert.serialNumber", "identity.clientCert.validity.notBefore": "$context.identity.clientCert.validity.notBefore", "identity.clientCert.validity.notAfter": "$context.identity.clientCert.validity.notAfter", "identity.sourceIp": "$context.identity.sourceIp", "identity.user": "$context.identity.user", "identity.userAgent": "$context.identity.userAgent", "identity.userArn": "$context.identity.userArn", "integration.error": "$context.integration.error", "integration.integrationStatus": "$context.integration.integrationStatus", "integration.latency": "$context.integration.latency", "integration.requestId": "$context.integration.requestId", "integration.status": "$context.integration.status", "integrationErrorMessage": "$context.integrationErrorMessage", "integrationLatency": "$context.integrationLatency", "integrationStatus": "$context.integrationStatus", "path": "$context.path", "protocol": "$context.protocol", "requestId": "$context.requestId", "requestTime": "$context.requestTime", "requestTimeEpoch": "$context.requestTimeEpoch", "responseLatency": "$context.responseLatency", "responseLength": "$context.responseLength", "routeKey": "$context.routeKey", "stage": "$context.stage", "status": "$context.status" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
APIGW requires it to all be on one line, so that's why its uggo. List of variables is from here: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-logging-variables.html
Formatted: