如何解决在 Cloud Logging 中具有现有过滤器的同时在所有字段中搜索值
我在 Cloud Logging 中有以下过滤器,可以显示来自特定实例的所有日志:
(resource.type="gce_instance" AND resource.labels.instance_id="***") OR (resource.type="global" AND jsonPayload.instance.id="***")
在这个集合中,我想在所有字段中搜索一个值。通过查看文档 https://cloud.google.com/logging/docs/view/advanced-queries#searching-examples,我发现我可以在查询字段中写一个简单的单词 unicorn
,它会在所有字段中进行搜索。它有效,但它会在我的所有日志中搜索。但我只想在过滤的日志集中搜索,而不是在 Cloud Logging 中的所有日志中搜索。我想获取包含单词 failed
的所有行并尝试这样做:
((resource.type="gce_instance" AND resource.labels.instance_id="***") OR (resource.type="global" AND jsonPayload.instance.id="***")) and failed
但是 id 不起作用。如何在已有过滤器的情况下搜索所有字段?
解决方法
最后一部分尝试以这种方式运行查询格式:
((resource.type="gce_instance" AND resource.labels.instance_id="***") OR
(resource.type="global" AND jsonPayload.instance.id="***")) AND "failed"
干杯,
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。