简体   繁体   English

如何在Azure流分析中检索自定义事件名称

[英]How to Retrieve a Custom Event Name in Azure Stream Analytics

I created a custom event that is tracked by Azure Application Insights. 我创建了一个由Azure Application Insights跟踪的自定义事件。 It has a few custom data properties I am able to successfully track, as well as 2 custom event properties of interest (one of which I cannot display). 它具有一些我可以成功跟踪的自定义数据属性,以及2个令人感兴趣的自定义事件属性(我无法显示其中一个)。

The one I cannot successfully query is the event name. 我无法成功查询的一个是事件名称。 I'm trying to reference it in the query by using event.name, but it's returning null for all records, even though I know for sure the names are not actually null. 我正在尝试使用event.name在查询中引用它,但是即使我确定名称实际上不是null,它也会为所有记录返回null。

显示名称属性的样本输入json文件

更多证明名称不应为空

当前查询。正在显示所有非循环属性

If anyone knows the proper way to query the custom event's name, please let me know! 如果有人知道查询自定义事件名称的正确方法,请告诉我! I can't find it on: https://docs.microsoft.com/en-us/azure/application-insights/app-insights-export-data-model 我在以下位置找不到它: https : //docs.microsoft.com/zh-cn/azure/application-insights/app-insights-export-data-model

The issue here is name is in an array, so event.name returns NULL since it doesn't exist. 这里的问题是name在数组中,因此event.name返回NULL,因为它不存在。

Will you always have only 1 name in this array? 在这个数组中,您是否总是只有1个名字? If so the following query will extract that value: 如果是这样,则以下查询将提取该值:

SELECT GetRecordPropertyValue(GetArrayElement(event, 0),'name')  as eventName from input

If you have various names, the query will depend of the logic (hence the suggestion to use CROSS APPLY). 如果您有各种名称,查询将取决于逻辑(因此建议使用CROSS APPLY)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM