2

I would like to exclude a string, or more generally a pattern from the app engine logs when I am auditing them in the app engine console.

I have tried the 'negative look ahead' solution described in Regular expression to match a line that doesn't contain a word? without success. Can someone post a working example?

Community
  • 1
  • 1
TTimo
  • 996
  • 1
  • 10
  • 18
  • It looks like this should work, I just tried this myself, it must be a bug in the console as it just stays on "Loading..." and never returns. I was using the regex:^((?!query).)*$ to filter out all rows containing the word "query". I have sent them feedback, i'll let update if I get a response. – IanGSY Sep 01 '14 at 20:18

3 Answers3

2

It appears this is now possible using the Advanced Search and combining operators with the NOT keyword. The simplest example is to use NOT before the text search expression:

resource.type="vpn_gateway"
"sending packet"
NOT "to 127.0.0.123"

This will search for vpn_gateway log entries containing the text "sending packet" and not containing the text "to 127.0.0.123"

More details is available in the Advanced Logs Filters Documentation.

Code Commander
  • 14,451
  • 5
  • 54
  • 63
1

This is now possible using the below:

=~          # regular expression search for a pattern

!~          # regular expression search not for a pattern

You can find more details here.

Currently I have enabled slow_query_log in MySql and I'm using the below to exclude some of the values stored in the log:

-textPayload=~"SET timestamp="
-textPayload=~"# User@Host: root[root] @  [127.0.0.1]"

Here's an example of each of the textPayloads:

SET timestamp=1607853094;
# User@Host: root[root] @  [127.0.0.1]  thread_id:  3735  server_id: 14545446173
Jim Jimson
  • 1,552
  • 2
  • 10
  • 31
0

It is currently not possible to do a negative search using logs viewer in the Google Developer Console. However there is a workaround exporting logs to Google BigQuery, there you can run these regular expressions on Request logs (and not app logs).

Eric Jay
  • 34
  • 2
Eric Jay
  • 36
  • 3