次の方法で共有


Set statement

Applies to: ✅Microsoft FabricAzure Data ExplorerAzure MonitorMicrosoft Sentinel

The set statement is used to set a request property for the duration of the query.

要求プロパティは、クエリの実行方法と結果を返す方法を制御します。 既定で false されるブール型フラグまたは整数値を指定できます。 クエリには任意の数の set ステートメントを含めることができます (含めなくてもかまいません)。 set ステートメントは、プログラムの順序で後にあるテーブル式ステートメントのみに影響します。 2 つのステートメントは、セミコロンで区切る必要があります。

要求プロパティは正式にはKusto 照会言語の一部ではなく、言語の破壊的変更と見なされずに変更される可能性があります。

Syntax

set OptionName [=OptionValue]

Learn more about syntax conventions.

Parameters

Name タイプ Required Description
OptionName string ✔️ 要求プロパティの名前。
OptionValue ✔️ 要求プロパティの値。

Example

このクエリでは、 query_take_max_records を使用して、 StormEvents テーブルから取得されるレコードの数を制限します。 (これは、 | take 100 演算子を使用する場合と多少同じです)。

The examples in this article use publicly available tables in the help cluster, such as the StormEvents table in the Samples database.

The examples in this article use publicly available tables, such as the Weather table in the Weather analytics sample gallery. ワークスペース内のテーブルと一致するように、クエリ例のテーブル名を変更する必要がある場合があります。

set query_take_max_records=100;
StormEvents

Output

この表は、最初のいくつかの結果を示しています。

StartTime EndTime EpisodeId EventId State EventType
2007-01-15T12:30:00Z 2007-01-15T16:00:00Z 1636 7821 OHIO Flood
2007-08-03T01:50:00Z 2007-08-03T01:50:00Z 10085 56083 NEW YORK Thunderstorm Wind
2007-08-03T15:33:00Z 2007-08-03T15:33:00Z 10086 56084 NEW YORK Hail
2007-08-03T15:40:00Z 2007-08-03T15:40:00Z 10086 56085 NEW YORK Hail
2007-08-03T23:15:00Z 2007-08-05T04:30:00Z 6569 38232 NEBRASKA Flood
2007-08-06T18:19:00Z 2007-08-06T18:19:00Z 6719 39781 IOWA Thunderstorm Wind
... ... ... ... ... ...