Cloudwatch Insights在多行日志中搜索 [英] Cloudwatch Insights search in multiline logs

查看:162
本文介绍了Cloudwatch Insights在多行日志中搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

示例日志:

REQUEST-ID:123 Video id=444
REQUEST-ID:123 Request=error
REQUEST-ID:534 Video id=555
REQUEST-ID:534 Request=ok

问题,如何查找所有带错误的请求的视频ID?

Question, how to find Video id of all requests with an error?

推荐答案

以下是来自AWS支持的官方回复:

Here is the official response from AWS support:

当前,我们不支持嵌套查询,因此Insights无法实现您的用例.但是,我们可以确认在此用例的末尾存在功能请求.现在尚没有实现该功能的预计时间.我希望你明白.请注意以下链接,以了解任何新功能更新:

Currently, we do not have support for nested queries, and hence your use-case won't be achievable with Insights. However, we can confirm that we have a feature request existing at our end for this use-case. We don't have an ETA now on when this will be implemented. I hope you understand. Please keep a watch on below link for any new feature updates:

https://aws.amazon.com/new/

作为一种解决方法,您现在可以下载部分查询结果(运行查询->操作->导出->下载查询结果(CSV)并过滤结果以标识视频ID.请在下面找到在这种情况下可以帮助您的一个示例查询:

As a workaround, for now, you could download partial query results(Run the query -> Actions -> Export -> Download query results(CSV) and filter the results to identify the video ids. Please find below one sample query that can help you in this case:

fields @timestamp, @message
| parse @message 'REQUEST-ID:* Request=*' as REQUESTID,Request
| parse @message 'REQUEST-ID:* Video id=*' as REQUESTIDVID,Videoid
| DISPLAY REQUESTID,Request,REQUESTIDVID,Videoid

这篇关于Cloudwatch Insights在多行日志中搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆