是否可以从CloudWatch将请求的$input variable(正文变量)记录到API网关?
自定义访问日志记录的日志格式似乎不接受$ input.body或任何其他$ input函数:
{"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()"}
答案 0 :(得分:0)
您可以按照访问记录中的说明使用var dlg = NSSavePanel.SavePanel;
dlg.NameFieldStringValue = defaultFileName;
变量
https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-logging.html。
不支持其他变量,包括$context
。如果要记录请求/响应标头值,则可以在启用“记录完整的请求/响应数据”的情况下使用执行记录。