amazon-web-services - 是否可以使用 aws 云监视日志见解在与正则表达式匹配的消息之前显示 n 条消息

标签 amazon-web-services amazon-cloudwatch aws-cloudwatch-log-insights

是否可以使用 aws 云监视日志见解在与正则表达式匹配的消息之前显示 n 条消息。 我必须在多个日志事件中放置一个过滤器。 日志消息序列示例:

<time> INFO Fetching data for apple.
<time> INFO Fetching data for mango.
<time> INFO Fetching data for orange.
<time> ERROR error message. 
<time> INFO Fetching data for banana.
<time> ERROR error message. 
<time> INFO Fetching data for jackfruit.
<time> INFO Fetching data for figs.

最佳答案

我不相信这是可能的。

一种选择是在查询的选择部分中包含@logStream,这将允许您单击日志流链接直接转到日志项,并向上滚动以查看之前的日志.

不适合您的情况,但可能会加快调试速度。

关于amazon-web-services - 是否可以使用 aws 云监视日志见解在与正则表达式匹配的消息之前显示 n 条消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62059382/

相关文章:

amazon-web-services - 将标签分配给 CloudFormation 模板中的特定资源

amazon-web-services - 通过 JPA spring boot 访问 AWS athena

amazon-web-services - 我们可以在/etc/awslogs/awslogs.conf 中设置 cloudwatch 日志保留天数吗

amazon-web-services - 如何使用 AWS CloudWatch Insights 查询 AWS CloudWatch 日志?

amazon-web-services - AWS 日志洞察 : specify @timestamp field output format/timezone?

amazon-web-services - 如何为aws log groups找到相应的资源?

amazon-web-services - 无服务器框架忽略 CLI 选项

node.js - 从具有相同跟踪 ID 的代码中调用 lambda?

aws-lambda - 如何使用 CloudFormation 添加订阅过滤器?

amazon-web-services - 如何实时查看aws日志(如tail -f)