Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handling single quote in AWS Cloudwatch Logs Insights

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?

like image 242
user8479984 Avatar asked Oct 19 '19 13:10

user8479984


Video Answer


1 Answers

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

like image 174
dmigo Avatar answered Sep 24 '22 21:09

dmigo