AWS Cloudwatch自定义指标过滤器

时间:2020-08-10 15:28:42

标签: amazon-cloudwatch amazon-cloudwatchlogs

我想在Apigateway日志上创建自定义cloudwatch过滤器,例如

2020-08-10T15:06:18.365Z    xxxxxxxx    INFO    received event: {
  "resource": "/myapi/mypath",
  "path": "/v4/myapi/mypath",
  "httpMethod": "GET",
  "headers": {
    "Accept": "application/json",
    "Accept-Encoding": "gzip, deflate",
    "Authorization": "******",
  },
  "queryStringParameters": {
    "resourceOwnerId": "e05xxxxx"
  },
  "pathParameters": null,
  "stageVariables": null,
  "requestContext": {
    "resourceId": "ok23l6",
    "authorizer": {
      "legacyUserId": "21602",
      "clientId": "client-xxxxxxxx",
    },
    "resourcePath": "/myapi/mypath",
    "httpMethod": "GET",

    "identity": {
      "cognitoIdentityPoolId": null,
      "cognitoIdentityId": null,
      "apiKey": "***************************************************9cb071",

    },
 
  },
  "body": null,
  "isBase64Encoded": false
}

我超出了要求,我想创建统计信息,其中客户针对给定路径进行了多少次呼叫。我想使用上述日志事件中请求正文中的以下字段。

“ clientId”:“ client-xxxxxxxx”, “ path”:“ / v4 / myapi / mypath”,

有人可以告诉我如何实现吗?

0 个答案:

没有答案