Rediger

Del via


Write Kusto Query Language queries in the Azure Data Explorer web UI

The Azure Data Explorer web UI query editor offers various features to help you write Kusto Query Language (KQL) queries. Some of these features include built-in KQL Intellisense and autocomplete, inline documentation, and quick fix pop-ups. In this article, we'll highlight what you should know when writing KQL queries in the web UI.

KQL Intellisense and autocomplete

The query editor has built-in KQL Intellisense that offers contextual suggestions for functions and operators, and autocomplete that completes your queries to save you time and effort.

To use KQL Intellisense and autocomplete:

  1. Start typing a query in the query editor.

  2. KQL Intellisense activates, presenting dropdown options for entities, operators, functions, and more. Move between these options using the arrow keys on your keyboard, and select one by pressing Enter or selecting the option with your mouse.

  3. If you notice underlined keywords, hover over them to reveal errors or suggestions that triggered the highlighting.

Moving screenshot showing how intellisense and autocomplete work.

View documentation inline

The query editor provides inline access to documentation for KQL operators, functions, and management commands.

To view inline documentation:

  1. Hover over the operator, function, or command in the Intellisense.

  2. Select the right arrow icon to open an inline preview of the documentation.

    Screenshot of inline KQL operator documentation.

    Note

    The preview remains active until you close it or end your session, even for other operators and functions.

  3. If you'd like to open the full documentation in your browser, select view online.

Quick fix: Query suggestion or warning

The query editor provides suggestions and warnings as you write your queries. The quick fix feature can be used to adjust the query based on these suggestions and warnings.

To fix a query based on a suggestion or warning:

  1. Hover over the term to view the suggestion or warning.

  2. Select Quick fix to show the available quick fix options.

  3. Select the desired quick fix option.

Screenshot of quick fix based on performance suggestion.

Tip

To customize the suggestions and warnings that you receive, see Customize settings in Azure Data Explorer web UI.

Quick fix: Extract value into a variable

The quick fix feature can also be used to extract out a value into a variable:

  1. Select the value to extract.

  2. Select the light bulb icon or press Ctrl + . to open the quick fix options.

  3. Select Extract value.

Screenshot of quick fix to extract value to variable.

Quick fix: Define functions inline

The quick fix feature can also be used to define an existing function inline before its use. Adding an inline function definition may be useful to improve readability and maintainability of your queries.

To show a function definition:

  1. Write and select the function name.

  2. Select the light bulb icon or press Ctrl + . to open the quick fix options.

  3. To define the function inline, select Inline (Inline function) or Inline Recursive (Inline function).

Moving screenshot of the define function quick fix feature.

Use KQL tools

The KQL tools in the toolbar help you quickly duplicate a query, open the command palette, or access documentation.

To use KQL tools:

  1. In the toolbar, select KQL tools.

  2. Choose from options like Duplicate query, Open command palette, or hover over Resources to access documentation links. This list includes resources such as the KQL to SQL cheat sheet, Keyboard shortcuts, and KQL quick reference documentation.

Screenshot of the KQL tools option in the web UI toolbar.