Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure 无法查询AppInsight日志_Azure_Azure Application Insights - Fatal编程技术网

Azure 无法查询AppInsight日志

Azure 无法查询AppInsight日志,azure,azure-application-insights,Azure,Azure Application Insights,我正在努力创建一个视觉查询 我想得到一个应用程序启动的次数,然后除以某个事件被触发的次数(拼写检查) 实际上,我有3个应用程序都使用相同的拼写检查功能,我想看看每个应用程序中拼写检查的使用量是否相同 //First, let's get the count of hasBeenUsed (how many times the application has been used) let app1Starts = customEvents | where timestamp > ago(3

我正在努力创建一个视觉查询

我想得到一个应用程序启动的次数,然后除以某个事件被触发的次数(拼写检查)

实际上,我有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
我收到了错误信息

“Summary”运算符:未能解析名为“app1Starts”的标量表达式

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

,也会发生同样的情况,您可以在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