我遵循文档中有关如何在CloudWatch Insights中访问JSON值的说明,其中的推荐如下
JSON arrays are flattened into a list of field names and values. For example, to specify the value of instanceId for the first item in requestParameters.instancesSet, use requestParameters.instancesSet.items.0.instanceId.
ref https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData-discoverable-fields.html
我正在尝试以下内容并得不到任何回报。 intellisense自动填充到processList.0
但没有进一步
fields processList.0.vss
| sort @timestamp desc
| limit 1
我正在使用的JSON是
"processList": [
{
"vss": xxxxx,
"name": "aurora",
"tgid": xxxx,
"vmlimit": "unlimited",
"parentID": 1,
"memoryUsedPc": 16.01,
"cpuUsedPc": 0.01,
"id": xxxxx,
"rss": xxxxx
},
{
"vss": xxxx,
"name": "aurora",
"tgid": xxxxxx,
"vmlimit": "unlimited",
"parentID": 1,
"memoryUsedPc": 16.01,
"cpuUsedPc": 0.06,
"id": xxxxx,
"rss": xxxxx
}]
你试过以下吗?
fields @@timestamp, @processList.0.vss
| sort @@timestamp desc
| limit 5
这可能是语法错误。如果没有,请发布一些总体结构的记录,包括@timestamp。