You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: learn-pr/wwl-sci/construct-kusto-query-language-statements/2-understand-kusto-query-language-statement-structure.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,8 @@ title: Understand the Kusto Query Language statement structure
4
4
metadata:
5
5
title: Understand the Kusto Query Language statement structure
6
6
description: "Understand the Kusto Query Language statement structure"
Copy file name to clipboardExpand all lines: learn-pr/wwl-sci/construct-kusto-query-language-statements/includes/2-understand-kusto-query-language-statement-structure.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,19 +6,19 @@ The tabular expression statement's syntax has tabular data flow from one tabular
6
6
7
7
For example, the following query has a single statement, which is a tabular expression statement. The statement starts with a table called SecurityEvent. The EventID column's value filters the data (rows) and then the results are summarized by creating a new column for the count() by Account. Next, in the Prepare phase, the results are then limited to 10 rows.
8
8
9
-
:::image type="content" source="../media/kql-pipe.png" alt-text="Diagram of K Q L Statement showing data, condition and evidence.":::
9
+
:::image type="content" source="../media/kql-pipe.png" alt-text="Diagram of K Q L Statement showing data, condition, and evidence.":::
10
10
11
11
> [!IMPORTANT]
12
-
> It is essential to understand how the results flow through the pipe "|". Everything on the left of the pipe is processed then passed to the right of the pipe.
12
+
> It's essential to understand how the results flow through the pipe "|". Everything on the left of the pipe is processed then passed to the right of the pipe.
13
13
14
14
## Access the Log Analytics demo environment
15
15
16
-
Microsoft provides access to an environment to practice writing KQL statements. The only requirement is to have an account to log into Azure. There are no charges to your Azure account to access this environment. You can execute the KQL statements in this module in the demo environment.
16
+
Microsoft provides access to an environment to practice writing KQL statements. The only requirement is to have an account to log into Azure. There are no charges to your Azure account to access this environment. You can execute the KQL statements in this module in the demo environment.
17
17
18
-
You can access the demo environment at the [Logs Demo site](https://aka.ms/lademo). If you receive the message "No results found", try changing the time range.
18
+
You can access the demo environment at the [Logs Demo site](https://aka.ms/lademo). If you receive the message *No results found*, try increasing the time range (or timeOffset) to > 30 days.
19
19
20
20
> [!IMPORTANT]
21
-
> The log analytics demo database is a dynamic environment. The events recorded in the tables in that environment are continuously updating with different security events. This is similar to what a person would experience in a real-world security operations setting. As a result, finite queries in this training may show no results depending on the state of the demo database at the time the query is run. For example, a query on the *SecurityEvent* table for "discardEventID = 4688" within the last day may show no results if that particular event last took place three days ago. Therefore, you may need to adjust variables in the scripts listed in this training ad hoc depending on what data is in the demo database at the time you run the script in order for the query to show results. These script adjustments are similar to what you would perform in the real world and should help you learn how the specific parts of the script function.
21
+
> The log analytics demo database is a dynamic environment. The events recorded in the tables in that environment are continuously updating with different security events. This is similar to what a person would experience in a real-world security operations setting. As a result, finite queries in this training may show no results depending on the state of the demo database at the time the query is run. For example, a query on the *SecurityEvent* table for "discardEventID = 4688" within the last day may show no results if that particular event last took place three days ago. Therefore, you may need to adjust variables in the scripts listed in this training depending on what data is in the demo database at the time you run the script in order for the query to show results. These script adjustments are similar to what you would perform in the real world and should help you learn how the specific parts of the script function.
22
22
23
23
:::image type="content" source="../media/log-analytics-demo-2.png" alt-text="Screenshot of the Log Analytics Demo Environment.":::
Copy file name to clipboardExpand all lines: learn-pr/wwl-sci/construct-kusto-query-language-statements/includes/5-use-let-statement.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,11 @@
1
-
Let statements bind names to expressions. For the rest of the scope, where the let statement appear, the name refers to its bound value. Let statements improve modularity and reuse since they allow you to break a potentially complex expression into multiple parts. Each part is bound to a name through the let statement, and together they compose the whole. Let statements allow for the creation of user-defined functions and views. The views are expressions whose results look like a new table.
1
+
Let statements bind names to expressions. For the rest of the scope, where the let statement appear, the name refers to its bound value. Let statements improve modularity and reuse since they allow you to break a potentially complex expression into multiple parts. Each part is bound to a name through the let statement, and together they compose the whole. Let statements allow for the creation of user-defined functions and views. The views are expressions whose results look like a new table.
2
2
3
3
## Declare and reuse variables
4
4
5
-
Let statements allow for the creation of variables to be used in later statements. In this example, timeOffSet and discardEventId are created and used as part of the SecurityEvent "where" clause.
5
+
Let statements allow for the creation of variables to be used in later statements. In this example, timeOffSet and discardEventId are created and used as part of the SecurityEvent "where" clause.
6
+
7
+
> [!NOTE]
8
+
> You may need to increase the timeOffset and time ranges to see results in the [Logs Demo site](https://aka.ms/lademo) environment. We suggest using > 30 days if you don't see results.
6
9
7
10
```kusto
8
11
let timeOffset = 7d;
@@ -14,7 +17,7 @@ SecurityEvent
14
17
```
15
18
16
19
> [!TIP]
17
-
> "ago()" is a function that will take the current Date and Time and subtract the value provided.
20
+
> "ago()" is a function that takes the current Date and Time and subtract the value provided.
18
21
19
22
## Declare dynamic tables or lists
20
23
@@ -35,4 +38,3 @@ let LowActivityAccounts =
35
38
| where cnt < 1000;
36
39
LowActivityAccounts | where Account contains "SQL"
title: Construct KQL statements for Microsoft Sentinel
5
5
description: "Construct KQL statements for Microsoft Sentinel"
6
-
ms.date: 09/20/2024
7
-
author: wwlpublish
6
+
ms.date: 05/02/2025
7
+
author: KenMAG
8
8
ms.author: kelawson
9
9
ms.topic: module
10
10
ms.service: microsoft-sentinel
11
11
title: Construct KQL statements for Microsoft Sentinel
12
-
summary: Kusto Query Language (KQL) is the query language used to perform analysis on data to create analytics, workbooks, and perform hunting in Microsoft Sentinel. Learn how basic KQL statement structure provides the foundation to build more complex statements.
12
+
summary: Kusto Query Language (KQL) is the query language used to perform analysis on data to create analytics, workbooks, and perform hunting in Microsoft Sentinel. Learn how basic KQL statement structure provides the foundation to build more complex statements.
13
13
abstract: |
14
14
Upon completion of this module, the learner is able to:
0 commit comments