在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)
但不起作用
只需在两行之间添加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)
如果要排除包含单词“unicorn”的条目,可以使用filter-text:unicorn
资料来源:https://cloud.google.com/logging/docs/view/basic-filters
顺便说一句,有时候\n
会结束。
您也可以单击日志,单击子条目和clik隐藏。