Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How make a filter "does not contain" in Google Stackdriver logs

Tags:

In Google Stackdriver advanced filter I can insert something like:

resource.type="container" resource.labels.cluster_name="mycluster" textPayload!="Metric stackdriver_sink_successfully_sent_entry_count was not found in the cache." severity="INFO" textPayload:(helloworld) 

The last rule means that the field textPayload should contain the string helloworld. But I'm not able to find a way to add a NOT operator.

I would use something like:

textPayload:!(helloworld) 

but doesn't work

like image 779
suikoy Avatar asked Dec 06 '17 09:12

suikoy


People also ask

What is GCP Stackdriver called now?

Stackdriver was upgraded in 2020 with new features and rebranded as part of the Google Cloud operations suite of tools. Google Cloud operations enables organizations to monitor, troubleshoot and operate cloud deployments.

What happened Stackdriver?

Last week, Google Cloud Platform (GCP) announced that it rebranded its Stackdriver monitoring and logging platform that Google acquired in 2014, to be part of its new Google Operations platform.

How do I query logs in GCP?

Search for text across log fields To see your search terms within the query expression, enable Show query. After you enter your search terms, click Run query or press the Enter key. The results of the query are displayed in the Query results pane.


1 Answers

just add AND NOT between two rows:

resource.type="container" resource.labels.cluster_name="mycluster" textPayload!="Metric stackdriver_sink_successfully_sent_entry_count was not found in the cache." severity="INFO" AND NOT textPayload:(helloworld) 
like image 100
suikoy Avatar answered Sep 30 '22 03:09

suikoy