简体   繁体   中英

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

from the log: "{\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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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