From 7d9ba97276e085e0d300a244ed990fdd63edce76 Mon Sep 17 00:00:00 2001
From: ktalmor <193799742+ktalmor@users.noreply.github.com>
Date: Sun, 12 Jan 2025 12:29:17 +0200
Subject: [PATCH 01/18] pattern-reviewed
---
.../kusto/query/pattern-statement.md | 32 +++++++++++++------
1 file changed, 23 insertions(+), 9 deletions(-)
diff --git a/data-explorer/kusto/query/pattern-statement.md b/data-explorer/kusto/query/pattern-statement.md
index d9e9840310..6c3cae0cb2 100644
--- a/data-explorer/kusto/query/pattern-statement.md
+++ b/data-explorer/kusto/query/pattern-statement.md
@@ -11,9 +11,13 @@ monikerRange: "microsoft-fabric || azure-data-explorer"
> [!INCLUDE [applies](../includes/applies-to-version/applies.md)] [!INCLUDE [fabric](../includes/applies-to-version/fabric.md)] [!INCLUDE [azure-data-explorer](../includes/applies-to-version/azure-data-explorer.md)] [!INCLUDE [monitor](../includes/applies-to-version/monitor.md)] [!INCLUDE [sentinel](../includes/applies-to-version/sentinel.md)]
-A **pattern** is a construct that maps string tuples to tabular expressions. Each pattern must *declare* a pattern name and optionally *define* a pattern mapping. Patterns that define a mapping return a tabular expression when invoked. Any two statements must be separated by a semicolon.
+A **pattern** is a construct that maps string tuples to tabular expressions. Each pattern must *declare* a pattern name and optionally *define* a pattern mapping.
-*Empty patterns* are patterns that are declared but don't define a mapping. When invoked, they return error *SEM0036* along with the details of the missing pattern definitions in the HTTP header. Middle-tier applications that provide a Kusto Query Language (KQL) experience can use the returned details as part of their process to enrich KQL query results.
+* Patterns that define a mapping return a tabular expression when invoked.
+* Separate any two statements by a semicolon.
+* Empty patterns are patterns that are declared but don't define a mapping. When invoked, they return error *SEM0036* along with the details of the missing pattern definitions in the HTTP header.
+
+Middle-tier applications that provide a Kusto Query Language (KQL) experience can use the returned details as part of their process to enrich KQL query results.
For more information, see [Working with middle-tier applications](#work-with-middle-tier-applications).
## Syntax
@@ -56,7 +60,7 @@ For more information, see [Working with middle-tier applications](#work-with-mid
## Examples
-In each of the following examples, a pattern is declared, defined, and then invoked.
+In the following examples, a pattern is declared, defined, and then invoked.
### Define simple patterns
@@ -83,13 +87,15 @@ country("Canada").Alberta
|-------|
|Edmonton|
+### Define a scoped pattern
+
+The following example defines a pattern that defines some scoped application data.
+
:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
> Run the query
::: moniker-end
-The following example defines a pattern that defines some scoped application data.
-
```kusto
declare pattern App = (applicationId:string)[scope:string]
{
@@ -147,23 +153,29 @@ union app("ApplicationX").["*"]
| count
```
-**Returns semantic error**
+**Output returns semantic error**
> One or more pattern references were not declared. Detected pattern references: ["app('ApplicationX').['*']"]
## Work with middle-tier applications
-A middle-tier application provides its users with the ability to use KQL and wants to enhance the experience by enriching the query results with augmented data from its internal service.
+A middle-tier application provides its users with the ability to enhance the KQL experience by enriching the query results with augmented data from its internal service.
-To this end, the application provides users with a pattern statement that returns tabular data that their users can use in their queries. The pattern's arguments are the keys the application will use to retrieve the enrichment data. When the user runs the query, the application does not parse the query itself but instead plans to leverage the error returned by an empty pattern to retrieve the keys it requires. So it prepends the query with the empty pattern declaration, sends it to the cluster for processing, and then parses the returned HTTP header to retrieve the values of missing pattern arguments. The application uses these values to look up the enrichment data and builds a new declaration that defines the appropriate enrichment data mapping. Finally, the application prepends the new definition to the user's query, resends it for processing, and returns the result it receives to the user.
+To this end, the application provides users with a pattern statement that returns tabular data that their users can use in their queries. The pattern's arguments are the keys the application will use to retrieve the enrichment data. When the user runs the query, the application doesn't parse the query itself but instead will leverage the error returned by an empty pattern to retrieve the keys it requires. So it prepends the query with the empty pattern declaration, sends it to the cluster for processing, and then parses the returned HTTP header to retrieve the values of missing pattern arguments. The application uses these values to look up the enrichment data and builds a new declaration that defines the appropriate enrichment data mapping. Finally, the application prepends the new definition to the user's query, resends it for processing, and returns the result it receives to the user.
### Example
-In the following example, a middle-tier application provides the ability to enrich queries with longitude/latitude locations. The application uses an internal service to map IP addresses to longitude/latitude locations, and provides a pattern called `map_ip_to_longlat` for this purpose. Let's suppose the application gets the following query from the user:
+In the examples, a pattern is declared, defined, and then invoked.
+
+#### Declare an empty pattern
+
+In the following example, a middle-tier application enriches queries with longitude/latitude locations. The application uses an internal service to map IP addresses to longitude/latitude locations, and provides a pattern called `map_ip_to_longlat` for this purpose. Let's suppose the application gets the following query from the user:
```kusto
map_ip_to_longlat("10.10.10.10")
```
+#### Declare and define a pattern
+
The application does not parse this query and hence does not know which IP address (*10.10.10.10*) was passed to the pattern. So it prepends the user query with an empty `map_ip_to_longlat` pattern declaration and sends it for processing:
```kusto
@@ -174,6 +186,8 @@ map_ip_to_longlat("10.10.10.10")
The application receives the following error in response.
> One or more pattern references were not declared. Detected pattern references: ["map_ip_to_longlat('10.10.10.10')"]
+#### Invoke a pattern
+
The application inspects the error, determines that the error indicates a missing pattern reference, and retrieves the missing IP address (*10.10.10.10*). It uses the IP address to look up the enrichment data in its internal service and builds a new pattern defining the mapping of the IP address to the corresponding longitude and latitude data. The new pattern is prepended to the user's query and run again. This time the query succeeds because the enrichment data is now declared in the query, and the result is sent to the user.
:::moniker range="azure-data-explorer"
From 79fab57ffc1f010ef160d879b343f1f8dc373538 Mon Sep 17 00:00:00 2001
From: ktalmor <193799742+ktalmor@users.noreply.github.com>
Date: Sun, 12 Jan 2025 15:59:22 +0200
Subject: [PATCH 02/18] patterns-fixes
---
data-explorer/kusto/query/alias-statement.md | 5 ++--
.../kusto/query/pattern-statement.md | 28 +++++++++++--------
2 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/data-explorer/kusto/query/alias-statement.md b/data-explorer/kusto/query/alias-statement.md
index 785a23e0d3..48479cd718 100644
--- a/data-explorer/kusto/query/alias-statement.md
+++ b/data-explorer/kusto/query/alias-statement.md
@@ -3,7 +3,7 @@ title: Alias statement
description: Learn how to use an alias statement to define an alias for a database that is used for a query.
ms.reviewer: alexans
ms.topic: reference
-ms.date: 08/11/2024
+ms.date: 01/12/2025
---
# Alias statement
@@ -13,7 +13,8 @@ Alias statements allow you to define an alias for databases, which can be used l
:::moniker range="azure-data-explorer"
This is useful when you're working with several clusters but want to appear as if you're working on fewer clusters.
-The alias must be defined according to the following syntax, where *clustername* and *databasename* are existing and valid entities.
+The alias must be defined according to the following syntax, where *clustername* and *databasename* are existing and valid entities][OIUYHGTFDSZzDXFGHJK['
+
## Syntax
diff --git a/data-explorer/kusto/query/pattern-statement.md b/data-explorer/kusto/query/pattern-statement.md
index 6c3cae0cb2..7fc1d7cf52 100644
--- a/data-explorer/kusto/query/pattern-statement.md
+++ b/data-explorer/kusto/query/pattern-statement.md
@@ -3,7 +3,7 @@ title: Pattern statement
description: Learn how to use pattern statements to map string tuples to tabular expressions.
ms.reviewer: alexans
ms.topic: reference
-ms.date: 08/11/2024
+ms.date: 01/12/2025
monikerRange: "microsoft-fabric || azure-data-explorer"
---
@@ -11,11 +11,11 @@ monikerRange: "microsoft-fabric || azure-data-explorer"
> [!INCLUDE [applies](../includes/applies-to-version/applies.md)] [!INCLUDE [fabric](../includes/applies-to-version/fabric.md)] [!INCLUDE [azure-data-explorer](../includes/applies-to-version/azure-data-explorer.md)] [!INCLUDE [monitor](../includes/applies-to-version/monitor.md)] [!INCLUDE [sentinel](../includes/applies-to-version/sentinel.md)]
-A **pattern** is a construct that maps string tuples to tabular expressions. Each pattern must *declare* a pattern name and optionally *define* a pattern mapping.
+A **pattern** is a construct that maps string tuples to tabular expressions.
-* Patterns that define a mapping return a tabular expression when invoked.
-* Separate any two statements by a semicolon.
-* Empty patterns are patterns that are declared but don't define a mapping. When invoked, they return error *SEM0036* along with the details of the missing pattern definitions in the HTTP header.
+Each pattern must *declare* a pattern name and optionally *define* a pattern mapping. Patterns that define a mapping return a tabular expression when invoked. Separate any two statements by a semicolon.
+
+Empty patterns are patterns that are declared but don't define a mapping. When invoked, they return error *SEM0036* along with the details of the missing pattern definitions in the HTTP header.
Middle-tier applications that provide a Kusto Query Language (KQL) experience can use the returned details as part of their process to enrich KQL query results.
For more information, see [Working with middle-tier applications](#work-with-middle-tier-applications).
@@ -60,11 +60,11 @@ For more information, see [Working with middle-tier applications](#work-with-mid
## Examples
-In the following examples, a pattern is declared, defined, and then invoked.
+In these examples, a pattern defined.
### Define simple patterns
-The following example defines a pattern that maps states to an expression that returns its capital/major city.
+This example defines a pattern that maps states to an expression that returns its capital/major city.
:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
@@ -89,7 +89,7 @@ country("Canada").Alberta
### Define a scoped pattern
-The following example defines a pattern that defines some scoped application data.
+This example defines a pattern to scope data and metrics of application data. The pattern is invoked to return a union of the data.
:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
@@ -160,7 +160,11 @@ union app("ApplicationX").["*"]
A middle-tier application provides its users with the ability to enhance the KQL experience by enriching the query results with augmented data from its internal service.
-To this end, the application provides users with a pattern statement that returns tabular data that their users can use in their queries. The pattern's arguments are the keys the application will use to retrieve the enrichment data. When the user runs the query, the application doesn't parse the query itself but instead will leverage the error returned by an empty pattern to retrieve the keys it requires. So it prepends the query with the empty pattern declaration, sends it to the cluster for processing, and then parses the returned HTTP header to retrieve the values of missing pattern arguments. The application uses these values to look up the enrichment data and builds a new declaration that defines the appropriate enrichment data mapping. Finally, the application prepends the new definition to the user's query, resends it for processing, and returns the result it receives to the user.
+To this end, the application provides users with a pattern statement that returns tabular data that their users can use in their queries. The pattern's arguments are the keys the application will use to retrieve the enrichment data.
+
+When the user runs the query, the application doesn't parse the query itself but instead uses the error returned by an empty pattern to retrieve the keys it requires. So it prepends the query with the empty pattern declaration, sends it to the cluster for processing, and then parses the returned HTTP header to retrieve the values of missing pattern arguments. The application uses these values to look up the enrichment data and builds a new declaration that defines the appropriate enrichment data mapping.
+
+Finally, the application prepends the new definition to the query, resends it for processing, and returns the result it receives to the user.
### Example
@@ -168,7 +172,7 @@ In the examples, a pattern is declared, defined, and then invoked.
#### Declare an empty pattern
-In the following example, a middle-tier application enriches queries with longitude/latitude locations. The application uses an internal service to map IP addresses to longitude/latitude locations, and provides a pattern called `map_ip_to_longlat` for this purpose. Let's suppose the application gets the following query from the user:
+In this example, a middle-tier application enriches queries with longitude/latitude locations. The application uses an internal service to map IP addresses to longitude/latitude locations, and provides a pattern called `map_ip_to_longlat`. When the query is run, it returns an error with missing pattern definitions:
```kusto
map_ip_to_longlat("10.10.10.10")
@@ -188,7 +192,9 @@ The application receives the following error in response.
#### Invoke a pattern
-The application inspects the error, determines that the error indicates a missing pattern reference, and retrieves the missing IP address (*10.10.10.10*). It uses the IP address to look up the enrichment data in its internal service and builds a new pattern defining the mapping of the IP address to the corresponding longitude and latitude data. The new pattern is prepended to the user's query and run again. This time the query succeeds because the enrichment data is now declared in the query, and the result is sent to the user.
+The application inspects the error, determines that the error indicates a missing pattern reference, and retrieves the missing IP address (*10.10.10.10*). It uses the IP address to look up the enrichment data in its internal service and builds a new pattern defining the mapping of the IP address to the corresponding longitude and latitude data. The new pattern is prepended to the user's query and run again.
+
+This time the query succeeds because the enrichment data is now declared in the query, and the result is sent to the user.
:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
From 1ccb413b45214766929368a10193d8feae2f09df Mon Sep 17 00:00:00 2001
From: ktalmor <193799742+ktalmor@users.noreply.github.com>
Date: Sun, 12 Jan 2025 16:34:10 +0200
Subject: [PATCH 03/18] Added link to sample
---
data-explorer/kusto/query/pattern-statement.md | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/data-explorer/kusto/query/pattern-statement.md b/data-explorer/kusto/query/pattern-statement.md
index 7fc1d7cf52..a98d0c194b 100644
--- a/data-explorer/kusto/query/pattern-statement.md
+++ b/data-explorer/kusto/query/pattern-statement.md
@@ -60,9 +60,11 @@ For more information, see [Working with middle-tier applications](#work-with-mid
## Examples
-In these examples, a pattern defined.
+In the [help cluster](https://dataexplorer.azure.com/clusters/help/), there's a `Samples` database with a `StormEvents` table.
-### Define simple patterns
+In these examples, a pattern is defined.
+
+### Define a simple pattern
This example defines a pattern that maps states to an expression that returns its capital/major city.
From 664094a47ea31abdb63979051818a3776564e3c5 Mon Sep 17 00:00:00 2001
From: ktalmor <193799742+ktalmor@users.noreply.github.com>
Date: Sun, 12 Jan 2025 16:39:48 +0200
Subject: [PATCH 04/18] alias-review
---
data-explorer/kusto/query/alias-statement.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/data-explorer/kusto/query/alias-statement.md b/data-explorer/kusto/query/alias-statement.md
index 48479cd718..865488b2f5 100644
--- a/data-explorer/kusto/query/alias-statement.md
+++ b/data-explorer/kusto/query/alias-statement.md
@@ -9,11 +9,11 @@ ms.date: 01/12/2025
> [!INCLUDE [applies](../includes/applies-to-version/applies.md)] [!INCLUDE [fabric](../includes/applies-to-version/fabric.md)] [!INCLUDE [azure-data-explorer](../includes/applies-to-version/azure-data-explorer.md)] [!INCLUDE [monitor](../includes/applies-to-version/monitor.md)] [!INCLUDE [sentinel](../includes/applies-to-version/sentinel.md)]
-Alias statements allow you to define an alias for databases, which can be used later in the same query.
+Alias statements allow you to define an alias for a database, which can be used in the same query.
:::moniker range="azure-data-explorer"
This is useful when you're working with several clusters but want to appear as if you're working on fewer clusters.
-The alias must be defined according to the following syntax, where *clustername* and *databasename* are existing and valid entities][OIUYHGTFDSZzDXFGHJK['
+The alias must be defined according to the following syntax, where *clustername* and *databasename* are existing and valid entities.
## Syntax
From dd7172fad492b726c0c678439385c785315ffb6e Mon Sep 17 00:00:00 2001
From: ktalmor <193799742+ktalmor@users.noreply.github.com>
Date: Mon, 13 Jan 2025 11:28:38 +0200
Subject: [PATCH 05/18] added missing output
---
data-explorer/kusto/query/let-statement.md | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/data-explorer/kusto/query/let-statement.md b/data-explorer/kusto/query/let-statement.md
index e04078be5b..646d00a589 100644
--- a/data-explorer/kusto/query/let-statement.md
+++ b/data-explorer/kusto/query/let-statement.md
@@ -91,6 +91,17 @@ let ['some number'] = 20;
range y from 0 to ['some number'] step 5
```
+**Output**
+
+|y|
+|---|
+|0|
+|5|
+|10|
+|15|
+|20|
+
+
### Create a user defined function with scalar calculation
This example uses the let statement with arguments for scalar calculation. The query defines function `MultiplyByN` for multiplying two numbers.
From bf25e2fe162fe3fa6c01b63282dce1109e1533e7 Mon Sep 17 00:00:00 2001
From: ktalmor <193799742+ktalmor@users.noreply.github.com>
Date: Mon, 13 Jan 2025 12:22:23 +0200
Subject: [PATCH 06/18] include-help-cluster
---
data-explorer/kusto/includes/help-cluster.md | 6 ++++++
1 file changed, 6 insertions(+)
create mode 100644 data-explorer/kusto/includes/help-cluster.md
diff --git a/data-explorer/kusto/includes/help-cluster.md b/data-explorer/kusto/includes/help-cluster.md
new file mode 100644
index 0000000000..3b2b161c57
--- /dev/null
+++ b/data-explorer/kusto/includes/help-cluster.md
@@ -0,0 +1,6 @@
+---
+ms.topic: include
+ms.date: 01/13/2025
+---
+
+In the [help cluster](https://dataexplorer.azure.com/clusters/help/), there's a `Samples` database with a `StormEvents` table.
\ No newline at end of file
From 3de710e65bc0d127e70848333cbfae2026e152a2 Mon Sep 17 00:00:00 2001
From: ktalmor <193799742+ktalmor@users.noreply.github.com>
Date: Mon, 13 Jan 2025 12:53:07 +0200
Subject: [PATCH 07/18] Added-include-help-cluster
---
data-explorer/kusto/query/alias-statement.md | 2 +-
data-explorer/kusto/query/batches.md | 2 ++
data-explorer/kusto/query/let-statement.md | 2 ++
data-explorer/kusto/query/pattern-statement.md | 2 ++
data-explorer/kusto/query/query-parameters-statement.md | 4 +++-
data-explorer/kusto/query/restrict-statement.md | 4 +++-
data-explorer/kusto/query/set-statement.md | 2 ++
data-explorer/kusto/query/tabular-expression-statements.md | 2 ++
8 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/data-explorer/kusto/query/alias-statement.md b/data-explorer/kusto/query/alias-statement.md
index 785a23e0d3..f90a772538 100644
--- a/data-explorer/kusto/query/alias-statement.md
+++ b/data-explorer/kusto/query/alias-statement.md
@@ -50,7 +50,7 @@ The alias must be defined according to the following syntax, where *Eventhouse*
## Examples
-In the [help cluster](https://dataexplorer.azure.com/clusters/help/), there's a `Samples` database with a `StormEvents` table.
+[!INCLUDE [help-cluster](../includes/help-cluster.md)]
First, count the number of records in that table.
diff --git a/data-explorer/kusto/query/batches.md b/data-explorer/kusto/query/batches.md
index 3998315bcb..d56c2480cd 100644
--- a/data-explorer/kusto/query/batches.md
+++ b/data-explorer/kusto/query/batches.md
@@ -18,6 +18,8 @@ A query can include multiple tabular expression statements, as long as they're d
## Examples
+[!INCLUDE [help-cluster](../includes/help-cluster.md)]
+
### Name tabular results
The following query produces two tabular results. User agent tools can then display those results with the appropriate name associated with each (`Count of events in Florida` and `Count of events in Guam`, respectively).
diff --git a/data-explorer/kusto/query/let-statement.md b/data-explorer/kusto/query/let-statement.md
index e04078be5b..b0d776ffb1 100644
--- a/data-explorer/kusto/query/let-statement.md
+++ b/data-explorer/kusto/query/let-statement.md
@@ -65,6 +65,8 @@ To optimize multiple uses of the `let` statement within a single query, see [Opt
## Examples
+[!INCLUDE [help-cluster](../includes/help-cluster.md)]
+
### Define scalar values
The following example uses a scalar expression statement.
diff --git a/data-explorer/kusto/query/pattern-statement.md b/data-explorer/kusto/query/pattern-statement.md
index d9e9840310..03cf739d1c 100644
--- a/data-explorer/kusto/query/pattern-statement.md
+++ b/data-explorer/kusto/query/pattern-statement.md
@@ -56,6 +56,8 @@ For more information, see [Working with middle-tier applications](#work-with-mid
## Examples
+[!INCLUDE [help-cluster](../includes/help-cluster.md)]
+
In each of the following examples, a pattern is declared, defined, and then invoked.
### Define simple patterns
diff --git a/data-explorer/kusto/query/query-parameters-statement.md b/data-explorer/kusto/query/query-parameters-statement.md
index 64c09c16f0..0f2b08a16e 100644
--- a/data-explorer/kusto/query/query-parameters-statement.md
+++ b/data-explorer/kusto/query/query-parameters-statement.md
@@ -3,7 +3,7 @@ title: Query parameters declaration statement
description: Learn how to use the query parameters declaration statement to parameterize queries and protect against injection attacks.
ms.reviewer: alexans
ms.topic: reference
-ms.date: 08/11/2024
+ms.date: 01/13/2025
monikerRange: "microsoft-fabric || azure-data-explorer"
---
# Query parameters declaration statement
@@ -44,6 +44,8 @@ To reference query parameters, the query text, or functions it uses, must first
## Example
+[!INCLUDE [help-cluster](../includes/help-cluster.md)]
+
:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
> Run the query
diff --git a/data-explorer/kusto/query/restrict-statement.md b/data-explorer/kusto/query/restrict-statement.md
index bee7e2d9fc..89109a33d7 100644
--- a/data-explorer/kusto/query/restrict-statement.md
+++ b/data-explorer/kusto/query/restrict-statement.md
@@ -3,7 +3,7 @@ title: Restrict statement
description: Learn how to use the restrict statement to limit tabular views that are visible to subsequent query statements.
ms.reviewer: alexans
ms.topic: reference
-ms.date: 08/11/2024
+ms.date: 01/13/2025
monikerRange: "microsoft-fabric || azure-data-explorer"
---
# Restrict statement
@@ -38,6 +38,8 @@ The middle-tier application can prefix the user's query with a **logical model**
## Examples
+[!INCLUDE [help-cluster](../includes/help-cluster.md)]
+
### Let statement
The following example uses a [let statement](let-statement.md) appearing before `restrict` statement.
diff --git a/data-explorer/kusto/query/set-statement.md b/data-explorer/kusto/query/set-statement.md
index 2fc5ad3fa3..37bc191ef3 100644
--- a/data-explorer/kusto/query/set-statement.md
+++ b/data-explorer/kusto/query/set-statement.md
@@ -35,6 +35,8 @@ Request properties aren't formally a part of the Kusto Query Language and may be
## Example
+[!INCLUDE [help-cluster](../includes/help-cluster.md)]
+
```kusto
set querytrace;
Events | take 100
diff --git a/data-explorer/kusto/query/tabular-expression-statements.md b/data-explorer/kusto/query/tabular-expression-statements.md
index 4c5b20004f..d5fa3079b2 100644
--- a/data-explorer/kusto/query/tabular-expression-statements.md
+++ b/data-explorer/kusto/query/tabular-expression-statements.md
@@ -41,6 +41,8 @@ A tabular data source produces sets of records, to be further processed by tabul
## Examples
+[!INCLUDE [help-cluster](../includes/help-cluster.md)]
+
### Filter rows by condition
The following query counts the number of records in the `StormEvents` table that have a value of "FLORIDA" in the `State` column.
From 64023baff08da7e840aa6020ac8a82df9c055aaa Mon Sep 17 00:00:00 2001
From: ktalmor <193799742+ktalmor@users.noreply.github.com>
Date: Mon, 13 Jan 2025 16:07:13 +0200
Subject: [PATCH 08/18] Query-statements-review-cont
---
data-explorer/kusto/query/batches.md | 35 +++++++++++++++++--
.../kusto/query/restrict-statement.md | 8 ++---
data-explorer/kusto/query/set-statement.md | 2 +-
.../query/tabular-expression-statements.md | 6 ++--
4 files changed, 41 insertions(+), 10 deletions(-)
diff --git a/data-explorer/kusto/query/batches.md b/data-explorer/kusto/query/batches.md
index d56c2480cd..a76db0b34a 100644
--- a/data-explorer/kusto/query/batches.md
+++ b/data-explorer/kusto/query/batches.md
@@ -3,7 +3,7 @@ title: Batches
description: This article describes Batches.
ms.reviewer: alexans
ms.topic: reference
-ms.date: 08/11/2024
+ms.date: 01/13/2025
---
# Batches
@@ -34,9 +34,19 @@ StormEvents | where State == "FLORIDA" | count | as ['Count of events in Florida
StormEvents | where State == "GUAM" | count | as ['Count of events in Guam']
```
+###Output###
+
+### [Florida](#tab/Count of events in Florida)
+
+1042
+
+### [Guam](#tab/Count of events in Guam)
+
+4
+
### Share a calculation
-Batching is useful for scenarios where a common calculation is shared by multiple subqueries, such as for dashboards. If the common calculation is complex, use the [materialize() function](materialize-function.md) and construct the query so that it will be executed only once:
+Batching is useful for scenarios where a common calculation is shared by multiple subqueries, such as for dashboards. If the common calculation is complex, use the [materialize() function](materialize-function.md) and construct the query so that it will be executed only once.
:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
@@ -48,3 +58,24 @@ let m = materialize(StormEvents | summarize n=count() by State);
m | where n > 2000;
m | where n < 10
```
+
+####Output####
+
+### [Table1](#tab/Table 1)
+
+| State | n |
+|-------|------|
+| ILLINOIS | 2022|
+| IOWA | 2337
+| KANSAS | 3166 |
+| MISSOURI | 2016
+| TEXAS | 4701 |
+
+### [Table2](#tab/Table 2)
+
+| State | n |
+|-------|------|
+| GUAM | 2022|
+| GULF OF ALASKA | 2337
+| HAWAII WATERS | 3166 |
+| LAKE ONTARIO | 2016
diff --git a/data-explorer/kusto/query/restrict-statement.md b/data-explorer/kusto/query/restrict-statement.md
index 89109a33d7..5d9210d910 100644
--- a/data-explorer/kusto/query/restrict-statement.md
+++ b/data-explorer/kusto/query/restrict-statement.md
@@ -42,7 +42,7 @@ The middle-tier application can prefix the user's query with a **logical model**
### Let statement
-The following example uses a [let statement](let-statement.md) appearing before `restrict` statement.
+The example uses a [let statement](let-statement.md) appearing before `restrict` statement.
```kusto
// Limit access to 'Test' let statement only
@@ -52,7 +52,7 @@ restrict access to (Test);
### Tables or functions
-The following example uses references to [tables](../management/tables.md) or [functions](../management/functions.md) that are defined in the database metadata.
+The example uses references to [tables](../management/tables.md) or [functions](../management/functions.md) that are defined in the database metadata.
```kusto
// Assuming the database that the query uses has table Table1 and Func1 defined in the metadata,
@@ -63,7 +63,7 @@ restrict access to (database().Table1, database().Func1, database('DB2').Table2)
### Patterns
-The following example uses wildcard patterns that can match multiples of [let statements](let-statement.md) or tables/functions.
+The example uses wildcard patterns that can match multiples of [let statements](let-statement.md) or tables/functions.
```kusto
let Test1 = () { print x=1 };
@@ -84,7 +84,7 @@ restrict access to (database('DB2').*);
### Prevent user from querying other user data
-The following example shows how a middle-tier application can prepend a user's query
+The example shows how a middle-tier application can prepend a user's query
with a logical model that prevents the user from querying any other user's data.
```kusto
diff --git a/data-explorer/kusto/query/set-statement.md b/data-explorer/kusto/query/set-statement.md
index 37bc191ef3..e8f3913c6c 100644
--- a/data-explorer/kusto/query/set-statement.md
+++ b/data-explorer/kusto/query/set-statement.md
@@ -3,7 +3,7 @@ title: Set statement
description: Learn how to use the set statement to set a request property for the duration of the query.
ms.reviewer: alexans
ms.topic: reference
-ms.date: 08/11/2024
+ms.date: 01/13/2025
monikerRange: "microsoft-fabric || azure-data-explorer"
---
# Set statement
diff --git a/data-explorer/kusto/query/tabular-expression-statements.md b/data-explorer/kusto/query/tabular-expression-statements.md
index d5fa3079b2..c275bc14eb 100644
--- a/data-explorer/kusto/query/tabular-expression-statements.md
+++ b/data-explorer/kusto/query/tabular-expression-statements.md
@@ -3,7 +3,7 @@ title: Tabular expression statements
description: Learn how to use tabular expression statements to produce tabular datasets.
ms.reviewer: alexans
ms.topic: reference
-ms.date: 08/11/2024
+ms.date: 01/13/2025
---
# Tabular expression statements
@@ -45,7 +45,7 @@ A tabular data source produces sets of records, to be further processed by tabul
### Filter rows by condition
-The following query counts the number of records in the `StormEvents` table that have a value of "FLORIDA" in the `State` column.
+This query counts the number of records in the `StormEvents` table that have a value of "FLORIDA" in the `State` column.
:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
@@ -66,7 +66,7 @@ StormEvents
### Combine data from two tables
-In the following example, the [join](join-operator.md) operator is used to combine records from two tabular data sources: the `StormEvents` table and the `PopulationData` table.
+In this example, the [join](join-operator.md) operator is used to combine records from two tabular data sources: the `StormEvents` table and the `PopulationData` table.
:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
From a6296218f92300061012bb563f1091f77e8a9ca4 Mon Sep 17 00:00:00 2001
From: ktalmor <193799742+ktalmor@users.noreply.github.com>
Date: Tue, 14 Jan 2025 14:54:41 +0200
Subject: [PATCH 09/18] Bold
---
data-explorer/kusto/query/batches.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/data-explorer/kusto/query/batches.md b/data-explorer/kusto/query/batches.md
index a76db0b34a..fd5bd3a73c 100644
--- a/data-explorer/kusto/query/batches.md
+++ b/data-explorer/kusto/query/batches.md
@@ -34,7 +34,7 @@ StormEvents | where State == "FLORIDA" | count | as ['Count of events in Florida
StormEvents | where State == "GUAM" | count | as ['Count of events in Guam']
```
-###Output###
+**Output**
### [Florida](#tab/Count of events in Florida)
From fee67514ec441c682dc0685f84895ba098570865 Mon Sep 17 00:00:00 2001
From: ktalmor <193799742+ktalmor@users.noreply.github.com>
Date: Tue, 14 Jan 2025 18:16:54 +0200
Subject: [PATCH 10/18] fixed table tabs
---
data-explorer/kusto/query/batches.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/data-explorer/kusto/query/batches.md b/data-explorer/kusto/query/batches.md
index fd5bd3a73c..dba0f5c420 100644
--- a/data-explorer/kusto/query/batches.md
+++ b/data-explorer/kusto/query/batches.md
@@ -36,11 +36,11 @@ StormEvents | where State == "GUAM" | count | as ['Count of events in Guam']
**Output**
-### [Florida](#tab/Count of events in Florida)
+### [Florida](#tab/Count_of_events_in_Florida)
1042
-### [Guam](#tab/Count of events in Guam)
+### [Guam](#tab/Count_of_events_in_Guam)
4
From 059b3615b42d8bae294c1528bb0f71d87d727c56 Mon Sep 17 00:00:00 2001
From: ktalmor <193799742+ktalmor@users.noreply.github.com>
Date: Wed, 15 Jan 2025 11:45:56 +0200
Subject: [PATCH 11/18] renamed include file
---
.../{help-cluster.md => help-cluster-samples-stormevents.md} | 0
data-explorer/kusto/query/alias-statement.md | 2 +-
data-explorer/kusto/query/batches.md | 2 +-
data-explorer/kusto/query/let-statement.md | 2 +-
data-explorer/kusto/query/pattern-statement.md | 2 +-
data-explorer/kusto/query/query-parameters-statement.md | 2 +-
data-explorer/kusto/query/restrict-statement.md | 2 +-
data-explorer/kusto/query/set-statement.md | 2 +-
data-explorer/kusto/query/tabular-expression-statements.md | 2 +-
9 files changed, 8 insertions(+), 8 deletions(-)
rename data-explorer/kusto/includes/{help-cluster.md => help-cluster-samples-stormevents.md} (100%)
diff --git a/data-explorer/kusto/includes/help-cluster.md b/data-explorer/kusto/includes/help-cluster-samples-stormevents.md
similarity index 100%
rename from data-explorer/kusto/includes/help-cluster.md
rename to data-explorer/kusto/includes/help-cluster-samples-stormevents.md
diff --git a/data-explorer/kusto/query/alias-statement.md b/data-explorer/kusto/query/alias-statement.md
index cfb097558d..0ce2adbd05 100644
--- a/data-explorer/kusto/query/alias-statement.md
+++ b/data-explorer/kusto/query/alias-statement.md
@@ -51,7 +51,7 @@ The alias must be defined according to the following syntax, where *Eventhouse*
## Examples
-[!INCLUDE [help-cluster](../includes/help-cluster.md)]
+[!INCLUDE [help-cluster](../includes/help-cluster-samples-stormevents.md)]
First, count the number of records in that table.
diff --git a/data-explorer/kusto/query/batches.md b/data-explorer/kusto/query/batches.md
index dba0f5c420..64ed76835e 100644
--- a/data-explorer/kusto/query/batches.md
+++ b/data-explorer/kusto/query/batches.md
@@ -18,7 +18,7 @@ A query can include multiple tabular expression statements, as long as they're d
## Examples
-[!INCLUDE [help-cluster](../includes/help-cluster.md)]
+[!INCLUDE [help-cluster](../includes/help-cluster-samples-stormevents.md)]
### Name tabular results
diff --git a/data-explorer/kusto/query/let-statement.md b/data-explorer/kusto/query/let-statement.md
index ca69140201..a503cc4dec 100644
--- a/data-explorer/kusto/query/let-statement.md
+++ b/data-explorer/kusto/query/let-statement.md
@@ -65,7 +65,7 @@ To optimize multiple uses of the `let` statement within a single query, see [Opt
## Examples
-[!INCLUDE [help-cluster](../includes/help-cluster.md)]
+[!INCLUDE [help-cluster](../includes/help-cluster-samples-stormevents.md)]
### Define scalar values
diff --git a/data-explorer/kusto/query/pattern-statement.md b/data-explorer/kusto/query/pattern-statement.md
index 5a39480029..acfa4b6c86 100644
--- a/data-explorer/kusto/query/pattern-statement.md
+++ b/data-explorer/kusto/query/pattern-statement.md
@@ -63,7 +63,7 @@ For more information, see [Working with middle-tier applications](#work-with-mid
<<<<<<< HEAD
In the [help cluster](https://dataexplorer.azure.com/clusters/help/), there's a `Samples` database with a `StormEvents` table.
=======
-[!INCLUDE [help-cluster](../includes/help-cluster.md)]
+[!INCLUDE [help-cluster](../includes/help-cluster-samples-stormevents.md)]
In each of the following examples, a pattern is declared, defined, and then invoked.
>>>>>>> 64023baff08da7e840aa6020ac8a82df9c055aaa
diff --git a/data-explorer/kusto/query/query-parameters-statement.md b/data-explorer/kusto/query/query-parameters-statement.md
index 0f2b08a16e..3eb7e68154 100644
--- a/data-explorer/kusto/query/query-parameters-statement.md
+++ b/data-explorer/kusto/query/query-parameters-statement.md
@@ -44,7 +44,7 @@ To reference query parameters, the query text, or functions it uses, must first
## Example
-[!INCLUDE [help-cluster](../includes/help-cluster.md)]
+[!INCLUDE [help-cluster](../includes/help-cluster-samples-stormevents.md)]
:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
diff --git a/data-explorer/kusto/query/restrict-statement.md b/data-explorer/kusto/query/restrict-statement.md
index 5d9210d910..e7db0058ed 100644
--- a/data-explorer/kusto/query/restrict-statement.md
+++ b/data-explorer/kusto/query/restrict-statement.md
@@ -38,7 +38,7 @@ The middle-tier application can prefix the user's query with a **logical model**
## Examples
-[!INCLUDE [help-cluster](../includes/help-cluster.md)]
+[!INCLUDE [help-cluster](../includes/help-cluster-samples-stormevents.md)]
### Let statement
diff --git a/data-explorer/kusto/query/set-statement.md b/data-explorer/kusto/query/set-statement.md
index e8f3913c6c..4aceeb710a 100644
--- a/data-explorer/kusto/query/set-statement.md
+++ b/data-explorer/kusto/query/set-statement.md
@@ -35,7 +35,7 @@ Request properties aren't formally a part of the Kusto Query Language and may be
## Example
-[!INCLUDE [help-cluster](../includes/help-cluster.md)]
+[!INCLUDE [help-cluster](../includes/help-cluster-samples-stormevents.md)]
```kusto
set querytrace;
diff --git a/data-explorer/kusto/query/tabular-expression-statements.md b/data-explorer/kusto/query/tabular-expression-statements.md
index c275bc14eb..3b5d738cb5 100644
--- a/data-explorer/kusto/query/tabular-expression-statements.md
+++ b/data-explorer/kusto/query/tabular-expression-statements.md
@@ -41,7 +41,7 @@ A tabular data source produces sets of records, to be further processed by tabul
## Examples
-[!INCLUDE [help-cluster](../includes/help-cluster.md)]
+[!INCLUDE [help-cluster](../includes/help-cluster-samples-stormevents.md)]
### Filter rows by condition
From a3c6306ef861f8f86ca5ff1f603e81ddba161d2b Mon Sep 17 00:00:00 2001
From: Shlomo Sagir <51323195+shsagir@users.noreply.github.com>
Date: Wed, 15 Jan 2025 11:56:18 +0200
Subject: [PATCH 12/18] Update data-explorer/kusto/query/batches.md
---
data-explorer/kusto/query/batches.md | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/data-explorer/kusto/query/batches.md b/data-explorer/kusto/query/batches.md
index dba0f5c420..a24ea6d874 100644
--- a/data-explorer/kusto/query/batches.md
+++ b/data-explorer/kusto/query/batches.md
@@ -36,13 +36,17 @@ StormEvents | where State == "GUAM" | count | as ['Count of events in Guam']
**Output**
-### [Florida](#tab/Count_of_events_in_Florida)
+### [Count_of_events_in_Florida](#tab/florida)
-1042
+| Count |
+| -- |
+| 1042 |
-### [Guam](#tab/Count_of_events_in_Guam)
+### [Count_of_events_in_Guam](#tab/guam)
-4
+| Count |
+| -- |
+| 4 |
### Share a calculation
From 82a2b8228d01093c3c1846b3fc45f79e33278d1f Mon Sep 17 00:00:00 2001
From: ktalmor <193799742+ktalmor@users.noreply.github.com>
Date: Wed, 15 Jan 2025 11:58:00 +0200
Subject: [PATCH 13/18] fix conceptual tab
---
data-explorer/kusto/query/batches.md | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/data-explorer/kusto/query/batches.md b/data-explorer/kusto/query/batches.md
index 64ed76835e..17cca5e891 100644
--- a/data-explorer/kusto/query/batches.md
+++ b/data-explorer/kusto/query/batches.md
@@ -36,13 +36,17 @@ StormEvents | where State == "GUAM" | count | as ['Count of events in Guam']
**Output**
-### [Florida](#tab/Count_of_events_in_Florida)
+### [Count of events in Florida](#tab/Florida)
-1042
+| Count |
+| --- |
+| 1042 |
-### [Guam](#tab/Count_of_events_in_Guam)
+### [Count of events in Guam](#tab/Guam)
-4
+| Count |
+| --- |
+| 4 |
### Share a calculation
@@ -59,7 +63,7 @@ m | where n > 2000;
m | where n < 10
```
-####Output####
+**Output**
### [Table1](#tab/Table 1)
From 5ce0d89081ee35b298e3a32b2fd695d2f88d9b32 Mon Sep 17 00:00:00 2001
From: ktalmor <193799742+ktalmor@users.noreply.github.com>
Date: Wed, 15 Jan 2025 12:04:26 +0200
Subject: [PATCH 14/18] closed section
---
data-explorer/kusto/query/batches.md | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/data-explorer/kusto/query/batches.md b/data-explorer/kusto/query/batches.md
index 65795450e2..6a34272c3a 100644
--- a/data-explorer/kusto/query/batches.md
+++ b/data-explorer/kusto/query/batches.md
@@ -36,18 +36,20 @@ StormEvents | where State == "GUAM" | count | as ['Count of events in Guam']
**Output**
-### [Count_of_events_in_Florida](#tab/florida)
+### [Count of events in Florida](#tab/florida)
| Count |
| -- |
| 1042 |
-### [Count_of_events_in_Guam](#tab/guam)
+### [Count of events in Guam](#tab/guam)
| Count |
| -- |
| 4 |
+---
+
### Share a calculation
Batching is useful for scenarios where a common calculation is shared by multiple subqueries, such as for dashboards. If the common calculation is complex, use the [materialize() function](materialize-function.md) and construct the query so that it will be executed only once.
From 3828ba786d02788595f3ffb3744a05a2e1103540 Mon Sep 17 00:00:00 2001
From: ktalmor <193799742+ktalmor@users.noreply.github.com>
Date: Wed, 15 Jan 2025 12:12:30 +0200
Subject: [PATCH 15/18] cleaned tables
---
data-explorer/kusto/query/batches.md | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/data-explorer/kusto/query/batches.md b/data-explorer/kusto/query/batches.md
index 6a34272c3a..eec2c34b76 100644
--- a/data-explorer/kusto/query/batches.md
+++ b/data-explorer/kusto/query/batches.md
@@ -67,21 +67,23 @@ m | where n < 10
**Output**
-### [Table1](#tab/Table 1)
+### [Table 1](#tab/table-1)
-| State | n |
-|-------|------|
-| ILLINOIS | 2022|
-| IOWA | 2337
+| State | n |
+|--|--|
+| ILLINOIS | 2022 |
+| IOWA | 2337 |
| KANSAS | 3166 |
-| MISSOURI | 2016
+| MISSOURI | 2016 |
| TEXAS | 4701 |
-### [Table2](#tab/Table 2)
+### [Table 2](#tab/table-2)
-| State | n |
-|-------|------|
-| GUAM | 2022|
-| GULF OF ALASKA | 2337
+| State | n |
+|--|--|
+| GUAM | 2022 |
+| GULF OF ALASKA | 2337 |
| HAWAII WATERS | 3166 |
-| LAKE ONTARIO | 2016
+| LAKE ONTARIO | 2016 |
+
+---
From 179331900823c63e2135a8f61f748a32eb836d7a Mon Sep 17 00:00:00 2001
From: ktalmor <193799742+ktalmor@users.noreply.github.com>
Date: Wed, 15 Jan 2025 12:26:58 +0200
Subject: [PATCH 16/18] minor fixes
---
.../kusto/query/pattern-statement.md | 27 ++++++++-----------
1 file changed, 11 insertions(+), 16 deletions(-)
diff --git a/data-explorer/kusto/query/pattern-statement.md b/data-explorer/kusto/query/pattern-statement.md
index acfa4b6c86..5da9d76f09 100644
--- a/data-explorer/kusto/query/pattern-statement.md
+++ b/data-explorer/kusto/query/pattern-statement.md
@@ -3,7 +3,7 @@ title: Pattern statement
description: Learn how to use pattern statements to map string tuples to tabular expressions.
ms.reviewer: alexans
ms.topic: reference
-ms.date: 01/12/2025
+ms.date: 01/15/2025
monikerRange: "microsoft-fabric || azure-data-explorer"
---
@@ -11,9 +11,9 @@ monikerRange: "microsoft-fabric || azure-data-explorer"
> [!INCLUDE [applies](../includes/applies-to-version/applies.md)] [!INCLUDE [fabric](../includes/applies-to-version/fabric.md)] [!INCLUDE [azure-data-explorer](../includes/applies-to-version/azure-data-explorer.md)] [!INCLUDE [monitor](../includes/applies-to-version/monitor.md)] [!INCLUDE [sentinel](../includes/applies-to-version/sentinel.md)]
-A **pattern** is a construct that maps string tuples to tabular expressions.
+A **pattern** is a construct that maps string tuples to tabular expressions.
-Each pattern must *declare* a pattern name and optionally *define* a pattern mapping. Patterns that define a mapping return a tabular expression when invoked. Separate any two statements by a semicolon.
+Each pattern must *declare* a pattern name and optionally *define* a pattern mapping. Patterns that define a mapping return a tabular expression when invoked. Separate any two statements by a semicolon.
Empty patterns are patterns that are declared but don't define a mapping. When invoked, they return error *SEM0036* along with the details of the missing pattern definitions in the HTTP header.
@@ -60,14 +60,8 @@ For more information, see [Working with middle-tier applications](#work-with-mid
## Examples
-<<<<<<< HEAD
-In the [help cluster](https://dataexplorer.azure.com/clusters/help/), there's a `Samples` database with a `StormEvents` table.
-=======
[!INCLUDE [help-cluster](../includes/help-cluster-samples-stormevents.md)]
-In each of the following examples, a pattern is declared, defined, and then invoked.
->>>>>>> 64023baff08da7e840aa6020ac8a82df9c055aaa
-
In these examples, a pattern is defined.
### Define a simple pattern
@@ -89,7 +83,7 @@ declare pattern country = (name:string)[state:string]
country("Canada").Alberta
```
-**Output**
+**Output**
|Capital|
|-------|
@@ -97,7 +91,7 @@ country("Canada").Alberta
### Define a scoped pattern
-This example defines a pattern to scope data and metrics of application data. The pattern is invoked to return a union of the data.
+This example defines a pattern to scope data and metrics of application data. The pattern is invoked to return a union of the data.
:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
@@ -105,7 +99,7 @@ This example defines a pattern to scope data and metrics of application data. Th
::: moniker-end
```kusto
-declare pattern App = (applicationId:string)[scope:string]
+declare pattern App = (applicationId:string)[scope:string]
{
('a1').['Data'] = { range x from 1 to 5 step 1 | project App = "App #1", Data = x };
('a1').['Metrics'] = { range x from 1 to 5 step 1 | project App = "App #1", Metrics = rand() };
@@ -161,16 +155,17 @@ union app("ApplicationX").["*"]
| count
```
-**Output returns semantic error**
+**Output semantic error**
+
> One or more pattern references were not declared. Detected pattern references: ["app('ApplicationX').['*']"]
## Work with middle-tier applications
-A middle-tier application provides its users with the ability to enhance the KQL experience by enriching the query results with augmented data from its internal service.
+A middle-tier application provides its users with the ability to use KQL and wants to enhnace the experience by enriching the query results with augmented data from its internal service.
To this end, the application provides users with a pattern statement that returns tabular data that their users can use in their queries. The pattern's arguments are the keys the application will use to retrieve the enrichment data.
-When the user runs the query, the application doesn't parse the query itself but instead uses the error returned by an empty pattern to retrieve the keys it requires. So it prepends the query with the empty pattern declaration, sends it to the cluster for processing, and then parses the returned HTTP header to retrieve the values of missing pattern arguments. The application uses these values to look up the enrichment data and builds a new declaration that defines the appropriate enrichment data mapping.
+When the user runs the query, the application doesn't parse the query itself but instead uses the error returned by an empty pattern to retrieve the keys it requires. So it prepends the query with the empty pattern declaration, sends it to the cluster for processing, and then parses the returned HTTP header to retrieve the values of missing pattern arguments. The application uses these values to look up the enrichment data and builds a new declaration that defines the appropriate enrichment data mapping.
Finally, the application prepends the new definition to the query, resends it for processing, and returns the result it receives to the user.
@@ -200,7 +195,7 @@ The application receives the following error in response.
#### Invoke a pattern
-The application inspects the error, determines that the error indicates a missing pattern reference, and retrieves the missing IP address (*10.10.10.10*). It uses the IP address to look up the enrichment data in its internal service and builds a new pattern defining the mapping of the IP address to the corresponding longitude and latitude data. The new pattern is prepended to the user's query and run again.
+The application inspects the error, determines that the error indicates a missing pattern reference, and retrieves the missing IP address (*10.10.10.10*). It uses the IP address to look up the enrichment data in its internal service and builds a new pattern defining the mapping of the IP address to the corresponding longitude and latitude data. The new pattern is prepended to the user's query and run again.
This time the query succeeds because the enrichment data is now declared in the query, and the result is sent to the user.
From ff6bacbcfda06dd4454768cfca81217c88343fc1 Mon Sep 17 00:00:00 2001
From: Shlomo Sagir <51323195+shsagir@users.noreply.github.com>
Date: Sun, 19 Jan 2025 14:13:39 +0200
Subject: [PATCH 17/18] Apply suggestions from code review
---
data-explorer/kusto/query/let-statement.md | 1 -
data-explorer/kusto/query/pattern-statement.md | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/data-explorer/kusto/query/let-statement.md b/data-explorer/kusto/query/let-statement.md
index a503cc4dec..df7d3b2e60 100644
--- a/data-explorer/kusto/query/let-statement.md
+++ b/data-explorer/kusto/query/let-statement.md
@@ -103,7 +103,6 @@ range y from 0 to ['some number'] step 5
|15|
|20|
-
### Create a user defined function with scalar calculation
This example uses the let statement with arguments for scalar calculation. The query defines function `MultiplyByN` for multiplying two numbers.
diff --git a/data-explorer/kusto/query/pattern-statement.md b/data-explorer/kusto/query/pattern-statement.md
index 5da9d76f09..d21b6850f6 100644
--- a/data-explorer/kusto/query/pattern-statement.md
+++ b/data-explorer/kusto/query/pattern-statement.md
@@ -161,7 +161,7 @@ union app("ApplicationX").["*"]
## Work with middle-tier applications
-A middle-tier application provides its users with the ability to use KQL and wants to enhnace the experience by enriching the query results with augmented data from its internal service.
+A middle-tier application provides its users with the ability to use KQL and wants to enhance the experience by enriching the query results with augmented data from its internal service.
To this end, the application provides users with a pattern statement that returns tabular data that their users can use in their queries. The pattern's arguments are the keys the application will use to retrieve the enrichment data.
From c16cabf750f1329f6bfa2211355db7ff9b9c539a Mon Sep 17 00:00:00 2001
From: Shlomo Sagir <51323195+shsagir@users.noreply.github.com>
Date: Mon, 20 Jan 2025 16:52:49 +0200
Subject: [PATCH 18/18] Update monitor-queued-ingestion.md
---
data-explorer/monitor-queued-ingestion.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/data-explorer/monitor-queued-ingestion.md b/data-explorer/monitor-queued-ingestion.md
index 3ce4af9eb5..74a4959358 100644
--- a/data-explorer/monitor-queued-ingestion.md
+++ b/data-explorer/monitor-queued-ingestion.md
@@ -269,5 +269,5 @@ Click away from the settings to get the full chart that compares the number of e
## Related content
* [Monitor Azure Data Explorer performance, health, and usage with metrics](using-metrics.md)
-* [Monitor Azure Data Explorer ingestion, commands, queries, and tables using diagnostic logs](using-diagnostic-logs.md)
+* [Monitor Azure Data Explorer ingestion, commands, queries, and tables using diagnostic logs](monitor-data-explorer.md#monitor-azure-data-explorer-ingestion-commands-queries-and-tables-using-diagnostic-logs)
* [Use Azure Monitor Insights](/azure/azure-monitor/insights/data-explorer)