在AWS日志见解中使用嵌套查询

发布于 2025-02-05 18:40:32 字数 534 浏览 2 评论 0原文

我正在使用AWS Lambdas托管一些服务。为了减轻冷启动问题,我正在使用“ nofollow noreferrer”>“ nofollow noreferrer”> serverless插件热身

现在使用CloudWatch日志见解,我打算在所有请求的请求中找出P99/P95,但排除了插件的请求。对于此查询,这应该有所帮助,请弄清插件调用的请求ID(我正在根据可以过滤这些请求来记录一条消息)。现在,我希望所有请求ID不在这些请求ID中的请求。在SQL中,这将转换为嵌套查询。

粗糙版本:

从requestIds中选择@duration noession In不在中(select requestId where @message @message *****)

我们是否有办法在日志见解中进行此类查询?

I am using AWS Lambdas to host some services. To mitigate issue of cold start, I'm using serverless plugin warmup.

Now using cloudwatch log insights, I intend to figure out p99/p95 of all the requests going to my lambda but exclude requests made by the plugin. For this one query which should help is , figure out requestIDs for plugin calls ( I'm logging a certain message based on which I can filter out those requests ). Now I want all those requests whose request IDS are not in these requests IDs. In sql this would transform to a nested query.

Rough version :

SELECT @duration from requestIDs where requestID not in ( SELECT RequestID where @message like ***** )

Do we have a way in which I can do such query in Log Insights?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

故笙诉离歌 2025-02-12 18:40:32

是的,您可以通过将所有消息用不喜欢条件输送到过滤器,然后删除pct(fieldName:fieldName:logfieldvalue,persep persect:number)函数>函数:

fields @duration
| filter @message not like "MESSAGE TO EXCLUDE"
| stats pct(@duration, 99)

Yes, you can remove messages from the warmup plugin by piping all messages to the filter with not like condition and then to pct(fieldName: LogFieldValue, percent: number) function:

fields @duration
| filter @message not like "MESSAGE TO EXCLUDE"
| stats pct(@duration, 99)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文