Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: ✅ Azure Data Explorer ✅ Azure Monitor ✅ Microsoft 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. |
Examples
The following example illustrates two styles of comments: a nested comment at the end of a line and a standalone comment on its own line. The query counts the number of events in the state of New York.
// 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