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