简体   繁体   English

Google Cloud Logging:显示匹配行上方和下方的行

[英]Google Cloud Logging: show lines above and below the matched lines

Sometimes when searching logs by keyword or other conditions, I want to show not only the lines which match the condition, but also a few lines around them to better understand the context, similar to the -C flag of grep .有时在按关键字或其他条件搜索日志时,我不仅想显示与条件匹配的行,还希望显示它们周围的几行以更好地理解上下文,类似于grep-C标志。

Is this possible?这可能吗?

I do not think it is possible to achieve this on Google Cloud Logging.我认为在 Google Cloud Logging 上不可能实现这一点。

I usually run a first query, get the timestamp of the log that I am interested in and then run a second query using Custom time range .我通常运行第一个查询,获取我感兴趣的日志的时间戳,然后使用Custom time range运行第二个查询。

Advanced logs queries 高级日志查询

Also looking for this.也在找这个。 What I found so far is the option to "Pin and show resource log entries" for a matched result.到目前为止,我发现的是匹配结果的“固定并显示资源日志条目”选项。 It will pin the entry, and then show it inline with the rest of the log它将固定条目,然后将其与日志的 rest 内联显示

单击图标后的固定选项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何让 Google Cloud Logging 以正确的警报级别显示我的 flask + gunicorn 应用程序的日志? - How can I get Google Cloud Logging to show my flask + gunicorn app's logs with the correct alert level? Google Cloud Console 日志记录中的正则表达式 - Regular Expressions in Google Cloud Console Logging Google Cloud Build 不显示任何日志 - Google Cloud Build show no logs Google Cloud 日志记录,仅针对新出现的错误发送 Slack 通知 - Google Cloud logging, sending slack notifications only for newly appeared errors 如何使用 IAM 用户对 Google Cloud Storage Bucket 进行日志记录和监控 - how to do Logging & Monitoring on Google Cloud Storage Buckets with IAM user 如何在 lumen/laravel 应用程序中使用谷歌云日志 - How to use google cloud logging at a lumen/laravel application 使用 Google Cloud Logging Python 库发送带有标签的 JSON 有效负载 - Send a JSON Payload with labels using Google Cloud Logging Python library 如何创建与请求日志的跟踪 ID 相关的 Google Cloud Logging 条目? - How to create Google Cloud Logging entries that are correlated with the request log's trace ID? 在 Google Cloud Dataflow 上运行的 Apache Beam 中禁用特定 class 的日志记录 - Disable logging from a specific class in Apache Beam running on Google Cloud Dataflow Google Cloud Console 不显示项目信息 - Google Cloud Console dosen't show project information
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM