在 KQL 中添加注释

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

表示用户提供的文本。 可以将注释插入单独的行中,嵌套在结尾或嵌套在 KQL 查询或命令中。 不评估注释文本。

语法

// 注释

详细了解语法约定

注解

使用两个斜杠 (//) 来添加注释。 下表列出了可用来注释或取消注释文本的键盘快捷键:

热键 说明
Ctrl+K+C 评论当前行或选定行。
Ctrl+K+U 取消评论当前行或选定行。

示例

此示例返回纽约州的事件计数:

// Return the count of events in the New York state from the StormEvents table
StormEvents
| where State == "NEW YORK" // Filter the records where the State is "NEW YORK"
| count