Handling single quote in AWS Cloudwatch Logs Insights

Viewed 10670

Here is some text that contains single-quotes:

Cannot read property 'email' of undefined:

When I run the below query with the above text

filter @message like /Cannot read property 'email' of undefined/
| stats count()

I am not able to get a count. However, in reality there are lots of above text in my logs.

Question is , how to escape the single quotes in the query?

1 Answers

You need to escape the quotes \'.
Like this:
/Cannot read property \'email\' of undefined/

Related