Let's present two ways to solve the problem...
I - Using filters (Log groups)
- Go to AWS CloudWatch;
- Click on "Log groups" ("Logs");
- Search for the desired log group;
- Select the desired log group;
- Click on "Search log group";
- Apply the desired filter in the relevant field and other desired search parameters.
FILTER EXAMPLE
?"ERROR" ?"Error" ?"error" ?"EXCEPT" ?"Except" ?"except"
NOTE: Allows you to search multiple cases - workaround for "case insensitive" - and by desired string part. The connector between the terms will be "OR".
II - Using queries (Logs Insights)
- Go to AWS CloudWatch;
- Click on "Logs Insights" ("Logs");
- Search for the desired log group;
- Select the desired log group;
- Insert your query;
- Apply other desired search parameters;
- Click on "Run query".
QUERY EXAMPLE
fields @timestamp, @message
| filter @message like /(?i)(error|except)/
| sort @timestamp desc
| limit 20
NOTE: Allows you to search case insensitive and by desired string part. The connector between the terms will be "OR".
Thanks! 🤗
[Ref(s).: https://mcmap.net/q/758451/-cloudwatch-logs-filter-case-insensitive-multiple-terms-or-connected , https://bneijt.nl/blog/cloudwatch-case-insensitive-like-filter/ , https://mcmap.net/q/402897/-how-do-we-sort-cloudwatch-stream-logs-by-39-most-recent-39-in-aws-console ]