13

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?

7
  • 2
    Have you tried to escape them like so: /Cannot read property \'email\' of undefined/? Commented Oct 19, 2019 at 14:44
  • Thanks for replying. I tried, but it does not gives any count. Commented Oct 20, 2019 at 8:27
  • And something like "Cannot read property 'email' of undefined"? Sorry for the blind guesses, I don't have AWS console at the moment :) Commented Oct 20, 2019 at 8:49
  • I tried: filter @message like /"Cannot read property 'email' of undefined"/ | stats count() but didnot work. Thanks again. Commented Oct 20, 2019 at 9:08
  • Sorry my bad. The first suggestion did WORK. By mistakenly, I was searching in an environment where the logs were not available. Using the backslash it worked under the environment where the logs were available and eventually started to give the actual count. Thanks a lot. Commented Oct 20, 2019 at 9:59

1 Answer 1

15

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.