如何根据另一个字段的值汇总字段?
我有一个Azure托管应用程序,其中一些用户一直抱怨登录困难。因此,我添加了一些在应用程序见解中显示的日志。数据示例如下所示:
我需要创建一个报告:显示的
- 唯一用户数(
dissidenifier
字段),该报告成功地登录了无法登录的唯一用户。 - 成功尝试之前(如果有的话)的失败登录尝试数 - 在KQL中是否可以?
我的尝试是:
customEvents
| order by timestamp asc
| summarize TotalUserCount=dcount(tostring(customDimensions["Identifier"])),
SuccessCount=countif(name startswith "Success"),
FailureCount=countif(name !startswith "Success")
但这是错误的,我需要countif(name ...)
也可以通过标识符
与众不同。
我是KQL的新手,因此感谢您的帮助。
谢谢。
I have an Azure hosted application in which some of our users have been complaining of difficulty logging-in. So I added some logs which show up in Application Insights. A sample of the data is shown below:
I need to create a report that shows:
- The number of unique users (the
Identifier
field) that successfully logged-in and the number of unique users that failed to login. - The number of failed login attempts that preceded a successful attempt (if any) - is this even possible in KQL?
One one my attempts was:
customEvents
| order by timestamp asc
| summarize TotalUserCount=dcount(tostring(customDimensions["Identifier"])),
SuccessCount=countif(name startswith "Success"),
FailureCount=countif(name !startswith "Success")
But this is wrong, I need countif(name...)
to also be distinct by Identifier
.
I'm new to KQL and so would appreciate some help.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我将从分析会话级别的数据开始。
It's very easy to take it from there and summarize it to the user level etc.
Fiddle
I would start from analyzing the data in the session level.
It's very easy to take it from there and summarize it to the user level etc.
Fiddle
如果我正确理解您的意图,则可以使用
dcountif
()。例如:
中是否可以尝试使用
scan> scan
操作员: https://learlen.microsoft.com/en-us /azure/data-explorer/kusto/query/scan-operatorIf I understood your intention correctly, you could use
dcountif
().For example:
You could try using the
scan
operator for this: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/scan-operator