google-cloud-logging - 在 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
但身份证不起作用。如何在已有过滤器的情况下搜索所有字段?
解决方案
尝试以这种方式运行查询格式的最后一部分:
((resource.type="gce_instance" AND resource.labels.instance_id="***") OR
(resource.type="global" AND jsonPayload.instance.id="***")) AND "failed"
干杯,
推荐阅读
- node.js - Express Server 连续抛出 404 错误
- git - GIT:如何将 Readme.md 文件从 master 复制到 Branch?
- generics - 包含闭包参数的方法需要错误的类型?
- python - 如何在 XML Python 中再迭代一个节点?
- python - 显示外键值
- ansible - azure_rm_dnszones 找不到资源组
- reactjs - React 模拟 Graphql 订阅
- java - Sparql 与 Java Jena
- python - TypeError: can't pickle _thread.RLock objects, K.shape 问题
- image - 如何为 Pneu Alpha 函数创建位图:错误位图格式无效。仅选择 16 或 256 色位图