简体   繁体   English

以下日志的 AWS cloudwatch 洞察查询组合

[英]AWS cloudwatch insight query composition for the following log

Trying to compose an insight query which would extract the following fields.尝试编写将提取以下字段的洞察查询。

apiname, endpoint, responseCode, status apiname、端点、响应代码、状态

from the log: "{\n \"apiName\": \"test_Authentication\",\n \"endpoint\": \"https://test.cloud.com\",\n \"responseCode\": 200,\n \"status\": \"Healthy\",\n}来自日志: "{\n \"apiName\": \"test_Authentication\",\n \"endpoint\": \"https://test.cloud.com\",\n \"responseCode\": 200,\n \"status\": \"Healthy\",\n}

As of now I am getting empty fields:截至目前,我得到空字段:

在此处输入图像描述

I tried with the parse message in the query which gave the result I am looking for.我尝试使用查询中的解析消息,它给出了我正在寻找的结果。

| parse @message '"apiName\":*,' as apiName
| parse @message '"endpoint\":*,' as endpoint
| parse @message '"responseCode\":*,' as responseCode
| parse @message '"status\":*,' as status
| sort @timestamp desc
| limit 20

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM