Skip to content

Commit 0bd077f

Browse files
authored
Merge pull request #291893 from yelevin/yelevin/kusto-updates
Corrected "KQL" code block headings to "Kusto"
2 parents 7ea0764 + eface66 commit 0bd077f

12 files changed

+38
-38
lines changed

articles/sentinel/audit-sentinel-data.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Use the **AzureActivity** table when auditing activity in your SOC environment w
4545

4646
The **AzureActivity** table includes data from many services, including Microsoft Sentinel. To filter in only data from Microsoft Sentinel, start your query with the following code:
4747

48-
```kql
48+
```kusto
4949
AzureActivity
5050
| where OperationNameValue startswith "MICROSOFT.SECURITYINSIGHTS"
5151
```
@@ -67,7 +67,7 @@ For more information, see [Microsoft Sentinel data included in Azure Activity lo
6767
6868
The following **AzureActivity** table query lists all actions taken by a specific Microsoft Entra user in the last 24 hours.
6969
70-
```kql
70+
```kusto
7171
AzureActivity
7272
| where OperationNameValue contains "SecurityInsights"
7373
| where Caller == "[AzureAD username]"
@@ -78,7 +78,7 @@ AzureActivity
7878

7979
The following **AzureActivity** table query lists all the delete operations performed in your Microsoft Sentinel workspace.
8080

81-
```kql
81+
```kusto
8282
AzureActivity
8383
| where OperationNameValue contains "SecurityInsights"
8484
| where OperationName contains "Delete"
@@ -150,7 +150,7 @@ LAQueryLogs data includes information such as:
150150

151151
For example, the following query shows how many queries were run in the last week, on a per-day basis:
152152

153-
```kql
153+
```kusto
154154
LAQueryLogs
155155
| where TimeGenerated > ago(7d)
156156
| summarize events_count=count() by bin(TimeGenerated, 1d)
@@ -162,7 +162,7 @@ The following sections show more sample queries to run on the **LAQueryLogs** ta
162162
163163
The following **LAQueryLogs** table query shows the number of queries run, where anything other than an HTTP response of **200 OK** was received. For example, this number includes queries that had failed to run.
164164
165-
```kql
165+
```kusto
166166
LAQueryLogs
167167
| where ResponseCode != 200
168168
| count
@@ -172,7 +172,7 @@ LAQueryLogs
172172

173173
The following **LAQueryLogs** table query lists the users who ran the most CPU-intensive queries, based on CPU used and length of query time.
174174

175-
```kql
175+
```kusto
176176
LAQueryLogs
177177
|summarize arg_max(StatsCPUTimeMs, *) by AADClientId
178178
| extend User = AADEmail, QueryRunTime = StatsCPUTimeMs
@@ -184,7 +184,7 @@ LAQueryLogs
184184

185185
The following **LAQueryLogs** table query lists the users who ran the most queries in the last week.
186186

187-
```kql
187+
```kusto
188188
LAQueryLogs
189189
| where TimeGenerated > ago(7d)
190190
| summarize events_count=count() by AADEmail
@@ -203,7 +203,7 @@ You might want to use Microsoft Sentinel auditing resources to create proactive
203203

204204
For example, if you have sensitive tables in your Microsoft Sentinel workspace, use the following query to notify you each time those tables are queried:
205205

206-
```kql
206+
```kusto
207207
LAQueryLogs
208208
| where QueryText contains "[Name of sensitive table]"
209209
| where TimeGenerated > ago(1d)

articles/sentinel/customize-entity-activities.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,13 @@ Add any of the following parameters to your query:
191191

192192
The `count` parameter adds the following command to your query in the background, even though it's not displayed fully in the editor:
193193

194-
```kql
194+
```kusto
195195
Summarize count() by <each parameter you’ve projected in the activity>
196196
```
197197
198198
Then, when you use the **Bucket Size** filter in the entity pages, the following command is also added to the query that's run in the background:
199199
200-
```kql
200+
```kusto
201201
Summarize count() by <each parameter you’ve projected in the activity>, bin (TimeGenerated, Bucket in Hours)
202202
```
203203

articles/sentinel/mssp-protect-intellectual-property.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ To do this, you need a workspace in your own tenant with Microsoft Sentinel enab
6969

7070
To create an analytic rule or hunting query in the MSSP tenant that references data in the customer tenant, you must use the `workspace` statement as follows:
7171

72-
```kql
72+
```kusto
7373
workspace('<customer-workspace>').SecurityEvent
7474
| where EventID == ‘4625’
7575
```

articles/sentinel/normalization-develop-parsers.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ For example, Infoblox DNS events are sent as Syslog messages, and are hard to di
120120

121121
To use the ASimSourceType watchlist in your parsers, use the `_ASIM_GetSourceBySourceType` function in the parser filtering section. For example, the Infoblox DNS parser includes the following in the filtering section:
122122

123-
```KQL
123+
```kusto
124124
| where Computer in (_ASIM_GetSourceBySourceType('InfobloxNIOS'))
125125
```
126126

@@ -193,7 +193,7 @@ The KQL operators that perform parsing are listed below, ordered by their perfor
193193

194194
The simplest form of normalization is renaming an original field to its normalized name. Use the operator `project-rename` for that. Using project-rename ensures that the field is still managed as a physical field and handling the field is more performant. For example:
195195

196-
```KQL
196+
```kusto
197197
| project-rename
198198
ActorUserId = InitiatingProcessAccountSid,
199199
ActorUserAadId = InitiatingProcessAccountObjectId,
@@ -208,7 +208,7 @@ Also, ensuring that parser output fields matches type defined in the schema is c
208208

209209
For example, the original unique event ID may be sent as an integer, but ASIM requires the value to be a string, to ensure broad compatibility among data sources. Therefore, when assigning the source field use `extend` and `tostring` instead of `project-rename`:
210210

211-
```KQL
211+
```kusto
212212
| extend EventOriginalUid = tostring(ReportId),
213213
```
214214

@@ -218,13 +218,13 @@ The value of the source field, once extracted, may need to be mapped to the set
218218

219219
For example, the Microsoft DNS parser assigns the `EventResult` field based on the Event ID and Response Code using an `iff` statement, as follows:
220220

221-
```KQL
221+
```kusto
222222
extend EventResult = iff(EventId==257 and ResponseCode==0 ,'Success','Failure')
223223
```
224224

225225
To map several values, define the mapping using the `datatable` operator and use `lookup` to perform the mapping. For example, some sources report numeric DNS response codes and the network protocol, while the schema mandates the more common text labels representation for both. The following example demonstrates how to derive the needed values using `datatable` and `lookup`:
226226

227-
```KQL
227+
```kusto
228228
let NetworkProtocolLookup = datatable(Proto:real, NetworkProtocol:string)[
229229
6, 'TCP',
230230
17, 'UDP'
@@ -245,7 +245,7 @@ Notice that lookup is useful and efficient also when the mapping has only two po
245245

246246
When the mapping conditions are more complex combine `iff`, `case`, and `lookup`. The example below shows how to combine `lookup` and `case`. The `lookup` example above returns an empty value in the field `DnsResponseCodeName` if the lookup value is not found. The `case` example below augments it by using the result of the `lookup` operation if available, and specifying additional conditions otherwise.
247247

248-
```KQL
248+
```kusto
249249
| extend DnsResponseCodeName =
250250
case (
251251
DnsResponseCodeName != "", DnsResponseCodeName,
@@ -257,7 +257,7 @@ When the mapping conditions are more complex combine `iff`, `case`, and `lookup`
257257

258258
Microsoft Sentinel provides handy functions for common lookup values. For example, the `DnsResponseCodeName` lookup above, can be implemented using one of the following functions:
259259

260-
```KQL
260+
```kusto
261261
262262
| extend DnsResponseCodeName = _ASIM_LookupDnsResponseCode(DnsResponseCode)
263263
@@ -273,7 +273,7 @@ For a full list of ASIM help functions, refer to [ASIM functions](normalization-
273273

274274
In addition to the fields available from the source, a resulting ASIM event includes enrichment fields that the parser should generate. In many cases, the parsers can assign a constant value to the fields, for example:
275275

276-
```KQL
276+
```kusto
277277
| extend
278278
EventCount = int(1),
279279
EventProduct = 'M365 Defender for Endpoint',
@@ -286,13 +286,13 @@ Another type of enrichment fields that your parsers should set are type fields,
286286

287287
In most cases, types are also assigned a constant value. However, in some cases the type has to be determined based on the actual value, for example:
288288

289-
```KQL
289+
```kusto
290290
DomainType = iif (array_length(SplitHostname) > 1, 'FQDN', '')
291291
```
292292

293293
<a name="resolvefqnd"></a>Microsoft Sentinel provides useful functions for handling enrichment. For example, use the following function to automatically assign the fields `SrcHostname`, `SrcDomain`, `SrcDomainType` and `SrcFQDN` based on the value in the field `Computer`.
294294

295-
```KQL
295+
```kusto
296296
| invoke _ASIM_ResolveSrcFQDN('Computer')
297297
```
298298

@@ -319,7 +319,7 @@ The following KQL operators are used to select fields in your results set:
319319

320320
For example, when parsing a custom log table, use the following to remove the remaining original fields that still have a type descriptor:
321321

322-
```KQL
322+
```kusto
323323
| project-away
324324
*_d, *_s, *_b, *_g
325325
```
@@ -392,7 +392,7 @@ To test ASIM, [deploy the ASIM testing tool](https://aka.ms/ASimTestingTools) to
392392

393393
To make sure that your parser produces a valid schema, use the ASIM schema tester by running the following query in the Microsoft Sentinel **Logs** page:
394394

395-
```KQL
395+
```kusto
396396
<parser name> | getschema | invoke ASimSchemaTester('<schema>')
397397
```
398398

@@ -428,7 +428,7 @@ Handle the results as follows:
428428

429429
To make sure that your parser produces valid values, use the ASIM data tester by running the following query in the Microsoft Sentinel **Logs** page:
430430

431-
```KQL
431+
```kusto
432432
<parser name> | limit <X> | invoke ASimDataTester ('<schema>')
433433
```
434434

articles/sentinel/normalization-functions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Enrichment lookup functions provide an easy method of looking up known values, b
2121

2222
The **lookup** version is a scalar function that accepts as input the numeric code and returns the textual form. Use the following KQL snippet with the **lookup** version:
2323

24-
```KQL
24+
```kusto
2525
| extend ProtocolName = _ASIM_LookupNetworkProtocol (ProtocolNumber)
2626
```
2727

@@ -33,7 +33,7 @@ The **resolve** version is a tabular function that:
3333

3434
Use the following KQL snippet with the **resolve** version:
3535

36-
```KQL
36+
```kusto
3737
| invoke _ASIM_ResolveNetworkProtocol (`ProtocolNumber`)
3838
```
3939

articles/sentinel/normalization-manage-parsers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ When adding an additional parser to a unifying custom parser that already refere
7676

7777
For example, the following code shows a custom unifying parser after having added the `added_parser`:
7878

79-
```KQL
79+
```kusto
8080
union isfuzzy=true
8181
existing_parser(starttime, endtime, srcipaddr, domain_has_any, responsecodename, response_has_ipv4, response_has_any_prefix, eventtype),
8282
added_parser(starttime, endtime, srcipaddr, domain_has_any, responsecodename, response_has_ipv4, response_has_any_prefix, eventtype)
@@ -137,7 +137,7 @@ When adding an additional parser to a unifying parser, make sure you add a comma
137137

138138
For example, the following example shows the DNS filtering unifying parser, after having added the custom `added_parser`:
139139

140-
```KQL
140+
```kusto
141141
let Generic=(starttime:datetime=datetime(null), endtime:datetime=datetime(null) , srcipaddr:string='*' , domain_has_any:dynamic=dynamic([]) , responsecodename:string='*', response_has_ipv4:string='*' , response_has_any_prefix:dynamic=dynamic([]) , eventtype:string='lookup' ){
142142
let DisabledParsers=materialize(_GetWatchlist('ASimDisabledParsers') | where SearchKey in ('Any', 'imDns') | extend SourceSpecificParser=column_ifexists('SourceSpecificParser','') | distinct SourceSpecificParser);
143143
let imDnsBuiltInDisabled=toscalar('imDnsBuiltIn' in (DisabledParsers) or 'Any' in (DisabledParsers));
@@ -159,7 +159,7 @@ Microsoft Sentinel users can directly modify workspace-deployed parsers. Create
159159

160160
For example, the following code shows a DNS filtering unifying parser, having replaced the `vimDnsAzureFirewall` parser with a modified version:
161161

162-
```KQL
162+
```kusto
163163
let Generic=(starttime:datetime=datetime(null), endtime:datetime=datetime(null) , srcipaddr:string='*' , domain_has_any:dynamic=dynamic([]) , responsecodename:string='*', response_has_ipv4:string='*' , response_has_any_prefix:dynamic=dynamic([]) , eventtype:string='lookup' ){
164164
let DisabledParsers=materialize(_GetWatchlist('ASimDisabledParsers') | where SearchKey in ('Any', 'imDns') | extend SourceSpecificParser=column_ifexists('SourceSpecificParser','') | distinct SourceSpecificParser);
165165
let imDnsBuiltInDisabled=toscalar('imDnsBuiltIn' in (DisabledParsers) or 'Any' in (DisabledParsers));

articles/sentinel/normalization-schema-audit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Some parameter can accept both list of values of type `dynamic` or a single stri
8080

8181
For example, to filter only audit events with the terms `install` or `update` in their [Operation](#operation) field, from the last day , use:
8282

83-
```kql
83+
```kusto
8484
imAuditEvent (operation_has_any=dynamic(['install','update']), starttime = ago(1d), endtime=now())
8585
```
8686

articles/sentinel/normalization-schema-authentication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The following filtering parameters are available:
6161

6262
For example, to filter only authentication events from the last day to a specific user, use:
6363

64-
```kql
64+
```kusto
6565
imAuthentication (targetusername_has = 'johndoe', starttime = ago(1d), endtime=now())
6666
```
6767

articles/sentinel/normalization-schema-dns.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ If your data source supports full DNS logging and you've chosen to log multiple
5959

6060
For example, you might modify your query with the following normalization:
6161

62-
```kql
62+
```kusto
6363
_Im_Dns | where SrcIpAddr != "127.0.0.1" and EventSubType == "response"
6464
```
6565

@@ -97,13 +97,13 @@ The following filtering parameters are available:
9797

9898
For example, to filter only DNS queries from the last day that failed to resolve the domain name, use:
9999

100-
```kql
100+
```kusto
101101
_Im_Dns (responsecodename = 'NXDOMAIN', starttime = ago(1d), endtime=now())
102102
```
103103

104104
To filter only DNS queries for a specified list of domain names, use:
105105

106-
```kql
106+
```kusto
107107
let torProxies=dynamic(["tor2web.org", "tor2web.com", "torlink.co"]);
108108
_Im_Dns (domain_has_any = torProxies)
109109
```
@@ -350,7 +350,7 @@ In most cases, logged DNS events don't include response information, which may b
350350

351351
You can also provide an extra KQL function called `_imDNS<vendor>Response_`, which takes the unparsed response as input and returns dynamic value with the following structure:
352352

353-
```kql
353+
```kusto
354354
[
355355
{
356356
"part": "answer"

articles/sentinel/normalization-schema-network.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Some parameter can accept both list of values of type `dynamic` or a single stri
7575

7676
For example, to filter only network sessions for a specified list of domain names, use:
7777

78-
```kql
78+
```kusto
7979
let torProxies=dynamic(["tor2web.org", "tor2web.com", "torlink.co"]);
8080
_Im_NetworkSession (hostname_has_any = torProxies)
8181
```

0 commit comments

Comments
 (0)