假设我有以下Insights查询
fields @timestamp, @message
| parse @message 'status=*" as status
| display @timestamp, status, @message
某些日志消息没有状态。我想过滤掉那些。我该怎么办?
答案 0 :(得分:1)
您可以使用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)