28

在 Google Stackdriver 高级过滤器中,我可以插入如下内容:

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)

最后一条规则意味着字段textPayload应该包含字符串helloworld。但我无法找到添加 NOT 运算符的方法。

我会使用类似的东西:

textPayload:!(helloworld)

但不起作用

4

3 回答 3

34

只需在两行之间添加 AND NOT:

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)
于 2017-12-06T13:24:10.837 回答
13

-text:unicorn如果要排除包含“独角兽”一词的条目,可以使用过滤器

来源:https ://cloud.google.com/logging/docs/view/basic-filters

于 2019-02-18T17:22:36.460 回答
0

顺便说一句,有时\n在最后。

您也可以单击日志,单击子条目并单击隐藏。

于 2018-05-16T22:16:33.373 回答