You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Application Insights事务搜索中筛选GET /user/*并排除GET /user/*/pets

在Application Insights中筛选GET /user/且排除/user//pets的请求

这个需求完全可以实现,直接用Application Insights的Kusto查询语言就能精准过滤:

方法一:基础匹配+排除

requests
| where operation_Name startswith "GET /user/"
| where operation_Name !contains "/pets"
  • 第一行指定查询请求数据表requests
  • 第二行筛选所有以GET /user/开头的请求
  • 第三行排除掉路径中包含/pets的请求

方法二:正则精准匹配

如果需要更严格匹配(比如只保留/user/xxx格式,不允许后续子路径),可以用正则表达式:

requests
| where operation_Name matches regex @"GET /user/[^/]+$"

这个表达式会匹配GET /user/后接任意非斜杠字符直到结尾的请求,自动排除/user/xxx/pets这类带后续路径的请求。

你只需要在Transaction Search界面点击右上角的「转到分析」(或直接切换到查询模式),输入上述语句即可得到目标结果。

内容的提问来源于stack exchange,提问作者Pure.Krome

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.03 09:53:01