gpt4 book ai didi

amazon-web-services - CloudWatch中的AWS API Gateway $ input变量

转载 作者:行者123 更新时间:2023-12-03 16:25:43 25 4
gpt4 key购买 nike

是否可以将请求的$input variable(主体变量)从CloudWatch记录到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()"}

最佳答案

简短答案:否

您可以在访问日志中使用$context变量,如

https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-logging.html

不支持其他变量,包括$input。如果要记录请求/响应 header 值,则可以在启用“记录完整的请求/响应数据”的情况下使用执行记录。

关于amazon-web-services - CloudWatch中的AWS API Gateway $ input变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49143311/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com