Skip to content

Commit 5708642

Browse files
committed
updates
1 parent 7c95098 commit 5708642

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

articles/log-analytics/log-analytics-cross-workspace-search.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,21 +100,21 @@ union Update, workspace("contosoretail-it").Update, workspace("b459b4u5-912x-46d
100100
## Using cross-resource query for multiple resources
101101
When using cross-resource queries to correlate data from multiple Log Analytics and Application Insights resources, the query can become complex and difficult to maintain. You should leverage [functions in Log Analytics](query-language/functions.md) to separate the query logic from the scoping of the query resources, which simplifies the query structure. The following example demonstrates how you can monitor multiple Application Insights resources and visualize the count of failed requests by application name.
102102
103-
Create a query like the following that references the scope of Application Insights resources. The `withsource= SourceApp` command adds a column that designates the application name that sent the log.
103+
Create a query like the following that references the scope of Application Insights resources. The `withsource= SourceApp` command adds a column that designates the application name that sent the log. [Save the query as function](query-language/functions.md#create-a-function) with the alias _applicationsScoping_.
104104
105105
```Kusto
106106
// crossResource function that scopes my Application Insights resources
107107
union withsource= SourceApp
108108
app('Contoso-app1').requests,
109-
app(''Contoso-app2').requests,
110-
app(''Contoso-app3').requests,
111-
app(''Contoso-app4').requests,
112-
app(''Contoso-app5').requests
109+
app('Contoso-app2').requests,
110+
app('Contoso-app3').requests,
111+
app('Contoso-app4').requests,
112+
app('Contoso-app5').requests
113113
```
114114

115-
[Save the query as function](query-language/functions.md#create-a-function) with the alias _applicationsScoping_.
116115

117-
You can now [use this function](query-language/functions.md#use-a-function) in a cross-resource query like the following. The Function alias _applicationsScoping_ returns the union of requests table from all the defined applications. The query then filters for failed requests and visualizes the trends by application
116+
117+
You can now [use this function](query-language/functions.md#use-a-function) in a cross-resource query like the following. The function alias _applicationsScoping_ returns the union of the requests table from all the defined applications. The query then filters for failed requests and visualizes the trends by application. The _parse_ operator is optional in this example. It extracts the application name from _SourceApp_ property.
118118

119119
```Kusto
120120
applicationsScoping
@@ -126,9 +126,6 @@ applicationsScoping
126126
| render timechart
127127
```
128128

129-
The _parse_ operator is optional in this example. It extracts the application name from _SourceApp_ property.
130-
131-
132129

133130
## Next steps
134131

articles/log-analytics/query-language/functions.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Create a function in the Azure portal by clicking **Save** and then providing th
5151
Use a function by including its alias in another query. It can be used like any other table.
5252

5353
## Example
54-
The following sample query returns all missing security updates reported in the last day:
54+
The following sample query returns all missing security updates reported in the last day. Save this query as a function with the alias _security_updates_last_day_.
5555

5656
```Kusto
5757
Update
@@ -60,9 +60,7 @@ Update
6060
| where UpdateState == "Needed"
6161
```
6262

63-
Save this query as a function with the alias _security_updates_last_day_.
64-
65-
Create another to search for SQL-related needed security updates:
63+
Create another to search for SQL-related needed security updates.
6664

6765
```Kusto
6866
security_updates_last_day | where Title contains "SQL"

0 commit comments

Comments
 (0)