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

facet 运算符

适用于:✅✅Azure 数据资源管理器Azure Monitor✅ Sentinel

返回一组表,其中一个表对应 facet 子句中指定的每一列。 每个表都包含其列获取的值列表。 可以使用 with 子句创建附加表。 任何附加运算符都无法重命名或引用分面结果表。

语法

T| facet byColumnName [,ColumnName2, ...] [with (filterPipe)]

详细了解语法约定

参数

客户 类型​​ 必需 描述
ColumnName string ✔️ 要汇总的列名称或列名称的列表。
filterPipe string 应用于输入表的查询表达式。

返回

多个表:with 子句对应一个表,每个列对应一个表。

示例

StormEvents
| where State startswith "A" and EventType has "Heavy"
| facet by State, EventType
    with 
    (
    where StartTime between(datetime(2007-01-04) .. 7d) 
    | project State, StartTime, Source, EpisodeId, EventType
    | take 5
    )

下面是由 with 子句生成的表。

状态 StartTime EpisodeId EventType
ALASKA 2007-01-04 12:00:00.0000000 COOP Observer 2192 大雪
ALASKA 2007-01-04 15:00:00.0000000 专业观测员 2192 大雪
ALASKA 2007-01-04 15:00:00.0000000 专业观测员 2192 大雪
ALASKA 2007-01-04 15:00:00.0000000 专业观测员 2192 大雪
ALASKA 2007-01-06 18:00:00.0000000 COOP Observer 2193 大雪

下表是 State 分面输出表。

状态 count_State
ALABAMA 19
ARIZONA 33
ARKANSAS 1
AMERICAN SAMOA 1
ALASKA 58

下表是 EventType 分面输出表。

EventType count_EventType
暴雨 34
大雪 78