您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

概述Overview

Kusto 查询是处理数据并返回结果的只读请求。A Kusto query is a read-only request to process data and return results. 该请求用纯文本形式表示,使用的数据流模型旨在使语法更易于阅读、创作和自动执行。The request is stated in plain text, using a data-flow model designed to make the syntax easy to read, author, and automate. 该查询使用以类似于 SQL 的层次结构组织的架构实体:数据库、表和列。The query uses schema entities that are organized in a hierarchy similar to SQL's: databases, tables, and columns.

该查询包含一系列由分号 (;) 分隔的查询语句,至少有一个语句是表格表达式语句,该语句可以生成按列和行的表式网格排列的数据。The query consists of a sequence of query statements, delimited by a semicolon (;), with at least one statement being a tabular expression statement which is a statement that produces data arranged in a table-like mesh of columns and rows. 查询的表格表达式语句生成查询结果。The query's tabular expression statements produce the results of the query.

表格表达语句的语法具有从一个表格查询运算符到另一个表格查询运算符的表格数据流,从数据源(例如,数据库中的一个表,或产生数据的运算符)开始,然后流经一组数据转换运算符,这些运算符通过使用竖线 (|) 分隔符绑定在一起。The syntax of the tabular expression statement has tabular data flow from one tabular query operator to another, starting with data source (e.g. a table in a database, or an operator that produces data) and then flowing through a set of data transformation operators that are bound together through the use of the pipe (|) delimiter.

例如,下面的 Kusto 查询有一个单独的语句,它是一个表格表达式语句。For example, the following Kusto query has a single statement, which is a tabular expression statement. 该语句从对名为 StormEvents 的表引用开始(宿主此表的数据库在此是隐式的,并且是连接信息的一部分)。The statement starts with a reference to a table called StormEvents (the database that host this table is implicit here, and part of the connection information). 然后,该表的数据(行)依次由 StartTime 列的值和 State 列的值进行筛选。The data (rows) for that table are then filtered by the value of the StartTime column, and then filtered by the value of the State column. 然后查询返回“幸存”的行计数。The query then returns the count of "surviving" rows.

StormEvents 
| where StartTime >= datetime(2007-11-01) and StartTime < datetime(2007-12-01)
| where State == "FLORIDA"  
| count 

若要运行此查询,请单击此处To run this query, click here. 在此情况下,结果将为:In this case, the result will be:

CountCount
2323