你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

fork 运算符

并行运行多个 consumer 运算符。

语法

T|fork [name=](subquery) [name=](subquery) ...

详细了解语法约定

参数

名称 类型 必需 说明
subquery string ✔️ 支持的查询运算符的下游管道。
name string 子查询结果表的临时名称。

注意

  • 请避免将 fork 与单个子查询一起使用。
  • 结果选项卡的名称将与通过 name 参数或 as 运算符提供的名称相同。

支持的查询运算符

返回

多个结果表,每个子查询参数一个。

提示

  • 在 fork 分支上,请使用 materialize 替换 joinunion。 输入流将通过 materialize 进行缓存,然后缓存的表达式可以在 join/union 分支中使用。

  • 批处理与表格表达式语句的 materialize 一起使用,而不是使用 fork 运算符。

示例

未命名的子查询

StormEvents
| where State == "FLORIDA"
| fork
    ( where DeathsDirect + DeathsIndirect > 1)
    ( where InjuriesDirect + InjuriesIndirect > 1)

命名子查询

在下面的示例中,结果表将被命名为“StormsWithDeaths”和“StormsWithInjuries”。

StormEvents
| where State == "FLORIDA"
| fork
    (where DeathsDirect + DeathsIndirect > 1 | as StormsWithDeaths)
    (where InjuriesDirect + InjuriesIndirect > 1 | as StormsWithInjuries)
StormEvents
| where State == "FLORIDA"
| fork
    StormsWithDeaths = (where DeathsDirect + DeathsIndirect > 1)
    StormsWithInjuries = (where InjuriesDirect + InjuriesIndirect > 1)

Azure Monitor 不支持此功能