gpt4 book ai didi

azure - 无法查询 AppInsight 日志

转载 作者:行者123 更新时间:2023-12-03 02:43:03 27 4
gpt4 key购买 nike

我正在努力创建 AppInsight 查询...

我想获取应用程序启动的次数,并将其除以触发特定事件的次数(拼写检查器)。

实际上,我有 3 个应用程序,它们都使用相同的拼写检查功能,我想看看每个应用程序中拼写检查的使用量是否相同。

//First, let's get the count of hasBeenUsed (how many times the application has been used) 
let app1Starts =
customEvents
| where timestamp > ago(30d)
| where name == 'hasBeenUsed';
| where customDimensions['payload.appId] == 'app1'
| summarize count();
//Now, let's get the count of how many times spellchecking has happened for that specific application
let spellCheckEvents =
customEvents
| where timestamp > ago(30d)
| where name == 'spellchecked';
| where customDimensions['payload.appId] == 'app1'
| summarize count();
//this is where I struggle
customEvents
| summarize app1Starts / spellCheckEvents //HELP ME PLEASE

我收到错误消息

'summarize' operator: Failed to resolve scalar expression named 'app1Starts'

如果我将最后一行从 summarize 更改为 extend

,也会发生同样的情况

最佳答案

您可以使用toscalar() let 语句中的运算符。

在您的情况下,查询应该是:

//First, let's get the count of hasBeenUsed (how many times the application has been used) 
let app1Starts =toscalar(
customEvents
| where timestamp > ago(30d)
| where name == 'hasBeenUsed'
| where customDimensions['payload.appId] == 'app1'
| summarize count());

//Now, let's get the count of how many times spellchecking has happened for that specific application
let spellCheckEvents =toscalar(
customEvents
| where timestamp > ago(30d)
| where name == 'spellchecked'
| where customDimensions['payload.appId] == 'app1'
| summarize count());

//then you can use the following statement
customEvents
| extend c1=app1Starts/spellCheckEvents

关于azure - 无法查询 AppInsight 日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60169554/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com