2

假设我有以下 Insights 查询

fields @timestamp, @message
| parse @message 'status=*" as status
| display @timestamp, status, @message

一些日志消息没有状态。我想过滤掉那些。我怎么做?

4

1 回答 1

6

您可以使用该ispresent()功能:https ://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html

像这样:

fields @timestamp, @message
| parse @message 'status=*" as status
| display @timestamp, status, @message
| filter ispresent(status)
于 2020-03-30T21:32:01.283 回答