首页 > 解决方案 > 如何使用 Application Insights 查询查询多个 Azure API 管理 API 名称

问题描述

您好,我正在努力通过 Azure API 管理获取请求,但是我正在获取所有 api。我想只过滤我需要的 api

这是我所做的:

requests
|summarize totalCount=sum(itemCount) by bin(timestamp,15m),toString(customDimensions.["API Name"])
where (toString(customDimensions.["API Name"]) == "api1" && "api2"
|render timechart

当我测试它告诉我 状态:有些东西坏了,我怎样才能过滤出我需要的所有 API

标签: azureloggingazure-api-managementappinsights

解决方案


将查询更改为

requests
| extend apiName = tostring(customDimensions.["API Name"])
| summarize totalCount=sum(itemCount) by bin(timestamp,15m),apiName
| where apiName in ("api1", "api2")
| render timechart

推荐阅读