Redigera

Dela via


Add a comment in KQL

Applies to: ✅ Microsoft FabricAzure Data ExplorerAzure MonitorMicrosoft Sentinel

Indicates user-provided text. Comments can be inserted on a separate line, nested at the end, or within a KQL query or command. The comment text isn't evaluated.

Syntax

// comment

Learn more about syntax conventions.

Remarks

Use the two slashes (//) to add comments. The following table lists the keyboard shortcuts that you can use to comment or uncomment text.

Hot Key Description
Ctrl+K+C Comment current line or selected lines.
Ctrl+K+U Uncomment current line or selected lines.

Example

This example returns a count of events in the New York state:

// 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