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

Riy*_*cis 2 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.
Run Code Online (Sandbox Code Playgroud)

tkw*_*rgs 5

我不相信这是可能的。

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

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