Quickstart: Query data in the Azure Data Explorer web UI
Azure Data Explorer is a fast, fully managed data analytics service for real-time analysis of large volumes of data. Azure Data Explorer provides a web experience that enables you to connect to your Azure Data Explorer clusters and write, run, and share Kusto Query Language commands and queries. The web experience is available in the Azure portal and as a stand-alone web application, the Azure Data Explorer web UI. The Azure Data Explorer web UI can also be hosted by other web portals in an HTML iframe. For more information on how to host the Azure Data Explorer web UI and the Monaco editor used, see Monaco IDE integration. In this quickstart, you'll be working in the stand-alone Azure Data Explorer web UI.
Prerequisites
- A Microsoft account or an Azure Active Directory user identity. An Azure subscription isn't required.
- An Azure Data Explorer cluster and database. You can create a free cluster, create a full cluster, or use the help cluster. To decide which is best for you, check the feature comparison.
Sign in to the application
Sign in to the application.
Add clusters
When you first open the application, there are no cluster connections.
You must add a connection to a cluster before you can start running queries. In this section, you’ll add connections to the Azure Data Explorer help cluster and to the test cluster you've created in the Prerequisites (optional).
Add help cluster
On the left menu, select Query.
In the upper left of the application, select Add Cluster.
In the Add cluster dialog box, enter the URI
https://help.kusto.windows.net
, then select Add.In the Cluster connection pane, you should now see the help cluster. Expand the Samples database and open the Tables folder to see the sample tables that you have access to.
We use the StormEvents table later in this quickstart, and in other Azure Data Explorer articles.
Add your cluster
Now add the test cluster you created.
Select Add Cluster.
In the Add Cluster dialog box, enter your test cluster URL in the form
https://<ClusterName>.<Region>.kusto.windows.net/
, then select Add. For example,https://mydataexplorercluster.westus.kusto.windows.net
as in the following image:In the example below, you see the help cluster and a new cluster, docscluster.westus (full URL is
https://docscluster.westus.kusto.windows.net/
).
Run queries
You can now run queries on both clusters (assuming you have data in your test cluster). For this article, we'll focus on the help cluster.
In the Cluster connection pane, under the help cluster, select the Samples database.
Copy and paste the following query into the query window. At the top of the window, select Run.
StormEvents | sort by StartTime desc | take 10
This query returns the 10 newest records in the StormEvents table. The result should look like the following table.
The following image shows the state of the application, with the cluster added, and a query with results.
Copy and paste the following query into the query window, below the first query. Notice how it isn't formatted on separate lines like the first query.
StormEvents | sort by StartTime desc | project StartTime, EndTime, State, EventType, DamageProperty, EpisodeNarrative | take 10
Select the new query. Press Shift+Alt+F to format the query, so it looks like the following query.
Select Run or press Shift+Enter to run a query. This query returns the same records as the first one, but includes only the columns specified in the
project
statement. The result should look like the following table.Tip
Select Recall at the top of the query window to show the result set from the first query without having to rerun the query. Often during analysis, you run multiple queries, and Recall allows you to retrieve the results of previous queries.
Let's run one more query to see a different type of output.
StormEvents | summarize event_count=count(), mid = avg(BeginLat) by State | sort by mid | where event_count > 1800 | project State, event_count | render columnchart
The result should look like the following chart.
Note
Blank lines in the query expression can affect which part of the query is executed.
- If no text selected, it's assumed that the query or command is separated by empty lines.
- If text is selected, the selected text is run.
Work with the results grid
Now that you've seen how basic queries work, you can use the results grid to customize results and do further analysis.
Expand a cell
Expanding cells are useful to view long strings or dynamic fields such as JSON.
Double-click a cell to open an expanded view. This view allows you to read long strings, and provides a JSON formatting for dynamic data.
Select on the icon on the top right of the result grid to switch reading pane modes. Choose between the following reading pane modes for expanded view: inline, below pane, and right pane.
Expand a row
When working with a table with dozens of columns, expand the entire row to be able to easily see an overview of the different columns and their content.
Click on the arrow > to the left of the row you want to expand.
Within the expanded row, some columns are expanded (arrow pointing down), and some columns are collapsed (arrow pointing right). Click on these arrows to toggle between these two modes.
Group column by results
Within the results, you can group results by any column.
Run the following query:
StormEvents | sort by StartTime desc | take 10
Mouse-over the State column, select the menu, and select Group by State.
In the grid, double-click on California to expand and see records for that state. This type of grouping can be helpful when doing exploratory analysis.
Mouse-over the Group column, then select Reset columns. This setting returns the grid to its original state.
Use value aggregation
After you've grouped by a column, you can then use the value aggregation function to calculate simple statistics per group.
Select the menu for the column you want to evaluate.
Select Value Aggregation, and then select the type of function you want to do on this column.
Hide empty columns
You can hide/unhide empty columns by toggling the eye icon on the results grid menu.
Filter columns
You can use one or more operators to filter the results of a column.
To filter a specific column, select the menu for that column.
Select the filter icon.
In the filter builder, select the desired operator.
Type in the expression you wish to filter the column on. Results are filtered as you type.
Note
The filter isn't case sensitive.
To create a multi-condition filter, select a boolean operator to add another condition
To remove the filter, delete the text from your first filter condition.
Run cell statistics
Run the following query.
StormEvents | sort by StartTime desc | where DamageProperty > 5000 | project StartTime, State, EventType, DamageProperty, Source | take 10
In the results grid, select a few of the numerical cells. The table grid allows you to select multiple rows, columns, and cells and calculate aggregations on them. The Azure Data Explorer web UI currently supports the following functions for numeric values: Average, Count, Min, Max, and Sum.
Filter to query from grid
Another easy way to filter the grid is to add a filter operator to the query directly from the grid.
Select a cell with content you wish to create a query filter for.
Right-click to open the cell actions menu. Select Add selection as filter.
A query clause will be added to your query in the query editor:
Pivot
The pivot mode feature is similar to Excel’s pivot table, enabling you to do advanced analysis in the grid itself.
Pivoting allows you to take a columns value and turn them into columns. For example, you can pivot on State to make columns for Florida, Missouri, Alabama, and so on.
On the right side of the grid, select Columns to see the table tool panel.
Select Pivot Mode, then drag columns as follows: EventType to Row groups; DamageProperty to Values; and State to Column labels.
The result should look like the following pivot table:
Search in the results grid
You can look for a specific expression within a result table.
Run the following query:
StormEvents | where DamageProperty > 5000 | take 1000
Click on the Search button on the right and type in "Wabash"
All mentions of your searched expression are now highlighted in the table. You can navigate between them by clicking Enter to go forward or Shift+Enter to go backward, or you can use the up and down buttons next to the search box.
Share queries
Many times, you want to share the queries you create.
In the query window, select the first query you copied in.
At the top of the query window, select Share.
The following options are available in the drop-down:
- Link to clipboard
- Link query to clipboard
- Link, query, results to clipboard
- Pin to dashboard
- Query to Power BI
Provide a deep link
You can provide a deep link so that other users with access to the cluster can run the queries.
In Share, select Link, query to clipboard.
Copy the link and query to a text file.
Paste the link into a new browser window. The result should look like the following
Pin to dashboard
When you complete data exploration using queries in the Azure Data Explorer web UI and find the data you need, you can pin it to a dashboard for continuous monitoring.
To pin a query:
In Share, select Pin to dashboard.
In the Pin to dashboard pane:
- Provide a Query name.
- Select Use existing or Create new.
- Provide Dashboard name
- Select the View dashboard after creation checkbox (if it's a new dashboard).
- Select Pin
Note
Pin to dashboard only pins the selected query. To create the dashboard data source and translate render commands to a visual in the dashboard, the relevant database must be selected in the database list.
Export query results
To export the query results to a CSV file, select File > Export to CSV.
Settings
In the Settings tab you can:
- Export environment settings
- Import environment settings
- Highlight error levels
- Clear local state
- Change datetime to specific time zone
Select the settings icon
on the top right, to open the Settings window.
Export and import environment settings
The export and import actions help you protect your work environment and relocate it to other browsers and devices. The export action will export all your settings, cluster connections, and query tabs to a JSON file that can be imported into a different browser or device.
Export environment settings
- In the Settings > General window, select Export.
- The adx-export.json file will be downloaded to your local storage.
- Select Clear local state to revert your environment to its original state. This setting deletes all your cluster connections and closes open tabs.
Note
Export only exports query related data. No dashboard data will be exported within the adx-export.json file.
Import environment settings
In the Settings > General window, select Import. Then in Warning pop-up, select Import.
Locate your adx-export.json file from your local storage and open it.
Your previous cluster connections and open tabs are now available.
Note
Import overrides any existing environment settings and data.
Highlight error levels
Kusto tries to interpret the severity or verbosity level of each row in the results panel and color them accordingly. It does this by matching the distinct values of each column with a set of known patterns ("Warning", "Error", and so on).
Enable error level highlighting
To enable the error level highlighting:
Select the Settings icon next to your user name.
Select the Appearance tab and toggle the Enable error level highlighting option to the right.
Error level color scheme in Light mode | Error level color scheme in Dark mode |
---|---|
![]() |
![]() |
Column requirements for highlighting
For highlighted error levels, the column must be of type int, long, or string.
- If the column is of type
long
orint
:- The column name must be Level
- Values may only include numbers between 1 and 5.
- If the column is of type
string
:- The column name can optionally be Level to improve performance.
- The column can only include the following values:
- critical, crit, fatal, assert, high
- error, e
- warning, w, monitor
- information
- verbose, verb, d
Change datetime to specific time zone
You can change the displayed datetime values to reflect a specific time zone. This change affects the display only, and doesn't change the underlying data in Azure Data Explorer.
Select the Settings icon next to your user name.
Select the General tab, and select a time zone from the dropdown menu.
The selected time zone will then be visible in the results grid menu bar.
Provide feedback
In the upper right of the application, select the feedback icon
.
Enter your feedback, then select Submit.
Clean up resources
You didn't create any resources in this quickstart, but if you'd like to remove one or both clusters from the application, right-click the cluster and select Remove connection. Another option is to select Clear local state from the Settings > General tab. This action will remove all cluster connections and close all open query tabs.