title: AWS API Gateway $input variable in CloudWatch
body: <p>Is it possible to log the <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#input-variable-reference" rel="noreferrer">$input variable</a> (body variables) of a request to API Gateway from CloudWatch?</p>
  
  <p>The Log format of the Custom Access Logging doesn't seem to accept $input.body or any of the other $input functions:</p>
  
  <pre><code>{"requestId": "$context.requestId",  "ip": "$context.identity.sourceIp",  "caller": "$context.identity.caller",  "user": "$context.identity.user",  "requestTime": "$context.requestTime",  "httpMethod": "$context.httpMethod",  "resourcePath": "$context.resourcePath",  "status": "$context.status",  "protocol": "$context.protocol",  "responseLength": "$context.responseLength", "body": "$input.body", params: "$input.params()"}
  </code></pre>