CloudWatch Insights 筛选为仅包含查询字符串的主页请求

CloudWatch Insights filter to only homepage requests including with query string

我们的日志中有一个 "url" 字段,我希望能够过滤到仅访问主页的请求。这将是 //?* 的请求,即任何查询字符串。

仅获取主页请求是 | filter url = "/",但是您如何包含那些也具有查询字符串的请求?

您可以使用正则表达式:https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html

像这样的东西应该可以工作:

filter url = "/" or url like /^\/\?.*/