【问题标题】:How to use filter on cloud/roleName in Azure Application Insights REST API如何在 Azure Application Insights REST API 中对 cloud/roleName 使用筛选器
【发布时间】:2020-10-06 17:46:49
【问题描述】:

我正在使用 Azure Application Insights REST API 来获取数据并希望在 cloud/roleName 上进行筛选。 cloud/roleName 上的过滤器不起作用。我在https://dev.applicationinsights.io/apiexplorer 中尝试过,它会显示“发生意外错误”消息。打开此网址了解更多详情。

https://dev.applicationinsights.io/apiexplorer/events?appId=DEMO_APP&apiKey=DEMO_KEY&eventType=requests&$filter=startswith(cloud%2FroleName%2C%20%27fabrikam%27)%20%20

如何在 cloud/roleName 上应用过滤器? 如果我再添加一个过滤器,那么它将起作用。这个网址有效 https://dev.applicationinsights.io/apiexplorer/events?appId=DEMO_APP&apiKey=DEMO_KEY&eventType=requests&$filter=startswith(cloud%2FroleName%2C%20%27fabrikam%27)%20and%20(request%2FresultCode%20ne%20%27200%27%20)

【问题讨论】:

  • 这很奇怪。使用get query 查询真实的应用洞察怎么样?
  • 您可以发布您的解决方案作为答案:)。

标签: azure-application-insights


【解决方案1】:

我正在使用 QueryAsync 方法并运行 kql 查询。它工作正常,但它会将数据作为表或 IEnumerable> 返回,因此将数据解析为强类型将是额外的工作。

【讨论】:

    猜你喜欢
    • 2022-12-03
    • 2021-04-05
    • 2020-04-05
    • 2023-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多