I'm searching Cloudwatch log events for errors with the following criteria:
?"error" ?"ERROR" ?"Error:"
How can I exclude specific terms from the result? For example, if I don't care about specific_error
, how can I specify not to match on it?
I'm expecting to be able to do something like:
(?"error" AND -"specific_error") ?"ERROR" ?"Error:"
In the CloudWatch console, this can be accomplished with the
-
operand before the term you wish to exclude:This is from the AWS docs for "Matching terms in log events".
Similarly, using
aws logs tail
, you can pass this to the--filter-pattern
argument: