CloudWatch-Insights: How to compare attributes on a query

0

I am trying to search for messages on AWS Insights with either matching or non matching attributes.

Specifically, Suppose I have an attribute "resp" and I want to search for messages which do not contain att.resp. Is something like that even feasible on AWS Insights?

Trying to do something similar to:

fields @timestamp, @message
| sort @timestamp desc
| filter @message not like att.resp 
已提問 2 年前檢視次數 984 次
1 個回答
1

I think you are asking to find all events which don't have a value for the field att.resp? In which case, you can use the *filter *command with the *ispresent *function, for example

fields @timestamp, @message
| sort @timestamp desc
| filter NOT ispresent(att.resp 

If you want to see more on the Logs Insights syntax see https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html.

AWS
AWS-SA
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南