KQL/Kusto distinct、extend 和 project 问题
Issue with KQL / Kusto distinct, extend and project
如果您想在项目或扩展运算符之后使用命令 distinct 和 distinct count,我真的不明白这是什么问题。
let planting_table = ['events.all']
| where FullName_Name == "plant_seed"
| extend SeedName = EventData.Payload.SeedName,
OasisName = EventData.Payload.OasisName,
TileName = EventData.Payload.TileName
| project-away SchemaVersion, FullName_Namespace, Entity_Id, Entity_Type,
EntityLineage_title, EventData, EntityLineage_title_player_account,
EntityLineage_namespace, ExperimentVariants, FullName_Name
| project-rename id = EntityLineage_master_player_account
;
planting_table
| summarize dcount(SeedName) by id
我的目标是在 Kusto/KQL 中按 ID 对种子名称进行不同计数。我怎样才能做到这一点?
为什么我不能在 extend 或 project operator 之后使用 distinct?
感谢您的帮助!
尝试使用 tostring()
函数将名为 SeedName
的 dynamic
属性 转换为 string
,以便您可以使用 distinct
运算符.
即
...
| extend SeedName = tostring(EventData.Payload.SeedName),
...
| summarize dcount(SeedName) by id
如果您想在项目或扩展运算符之后使用命令 distinct 和 distinct count,我真的不明白这是什么问题。
let planting_table = ['events.all']
| where FullName_Name == "plant_seed"
| extend SeedName = EventData.Payload.SeedName,
OasisName = EventData.Payload.OasisName,
TileName = EventData.Payload.TileName
| project-away SchemaVersion, FullName_Namespace, Entity_Id, Entity_Type,
EntityLineage_title, EventData, EntityLineage_title_player_account,
EntityLineage_namespace, ExperimentVariants, FullName_Name
| project-rename id = EntityLineage_master_player_account
;
planting_table
| summarize dcount(SeedName) by id
我的目标是在 Kusto/KQL 中按 ID 对种子名称进行不同计数。我怎样才能做到这一点? 为什么我不能在 extend 或 project operator 之后使用 distinct?
感谢您的帮助!
尝试使用 tostring()
函数将名为 SeedName
的 dynamic
属性 转换为 string
,以便您可以使用 distinct
运算符.
即
...
| extend SeedName = tostring(EventData.Payload.SeedName),
...
| summarize dcount(SeedName) by id