用例:在Azure Application Insights中,从Azure Web应用程序每页创建视图表
在Azure Application Insights中使用Kusto,我想合并表1中的行:
进入表2:
[不幸的是,下面的查询将第一列(第一行除外)中的单元格替换为第二列中的单元格。这取决于查询的编写方式。不幸的是,这是错误的,不是我的目标。
pageViews
| where timestamp between(datetime("2020-03-01T00:00:00.000Z")..datetime("2020-06-01T00:00:00.000Z"))
| extend guide = case(
url contains "/guide-1/","guide-1",
url contains "/guide-2/","guide-2",
url contains "/guide-3/","guide-3",
"home-page"
)
| extend tag = case(
url contains "/guide-1/","install",
guide contains "home-page","home-page",
"how-to"
)
| extend name = case(
name contains "Welcome to docs","Welcome to docs",
"home-page" //This is incorrect - nothing should happen if the name does not contain "Welcome to docs"
)
| summarize Ocurrences=count() by name, tag, guide
由于缺乏对Kusto的了解,我在Microsoft文档中搜索了一种方法,该方法可以在不满足条件但又没有提出任何建议的情况下“不执行任何操作”。我尝试了iff
,但没有成功。
谢谢您的帮助,如果这种方法不是最好的话,请提供建议。
如果您希望在某些情况下保留“名称”,则可以这样做: