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: articles/azure-monitor/log-query/unify-app-resource-data.md
+2-31Lines changed: 2 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ ms.author: bwren
6
6
ms.workload: na
7
7
ms.tgt_pltfrm: na
8
8
ms.topic: conceptual
9
-
ms.date: 02/19/2019
9
+
ms.date: 02/02/2020
10
10
11
11
---
12
12
@@ -16,12 +16,7 @@ This article describes how to query and view all your Application Insights log d
16
16
## Recommended approach to query multiple Application Insights resources
17
17
Listing multiple Application Insights resources in a query can be cumbersome and difficult to maintain. Instead, you can leverage function to separate the query logic from the applications scoping.
18
18
19
-
This example demonstrates how you can monitor multiple Application Insights resources and visualize the count of failed requests by application name. Before you begin, run this query in the workspace that is connected to Application Insights resources to get the list of connected applications:
20
-
21
-
```
22
-
ApplicationInsights
23
-
| summarize by ApplicationName
24
-
```
19
+
This example demonstrates how you can monitor multiple Application Insights resources and visualize the count of failed requests by application name.
25
20
26
21
Create a function using union operator with the list of applications, then save the query in your workspace as function with the alias *applicationsScoping*.
27
22
@@ -57,33 +52,9 @@ The query uses Application Insights schema, although the query is executed in th
## Query across Application Insights resources and workspace data
61
-
When you stop the Connector and need to perform queries over a time range that was trimmed by Application Insights data retention (90 days), you need to perform [cross-resource queries](../../azure-monitor/log-query/cross-workspace-query.md) on the workspace and Application Insights resources for an intermediate period. This is until your applications data accumulates per the new Application Insights data retention mentioned above. The query requires some manipulations since the schemas in Application Insights and the workspace are different. See the table later in this section highlighting the schema differences.
62
-
63
55
>[!NOTE]
64
56
>[Cross-resource query](../log-query/cross-workspace-query.md) in log alerts is supported in the new [scheduledQueryRules API](https://docs.microsoft.com/rest/api/monitor/scheduledqueryrules). By default, Azure Monitor uses the [legacy Log Analytics Alert API](../platform/api-alerts.md) for creating new log alert rules from Azure portal, unless you switch from [legacy Log Alerts API](../platform/alerts-log-api-switch.md#process-of-switching-from-legacy-log-alerts-api). After the switch, the new API becomes the default for new alert rules in Azure portal and it lets you create cross-resource query log alerts rules. You can create [cross-resource query](../log-query/cross-workspace-query.md) log alert rules without making the switch by using the [ARM template for scheduledQueryRules API](../platform/alerts-log.md#log-alert-with-cross-resource-query-using-azure-resource-template) – but this alert rule is manageable though [scheduledQueryRules API](https://docs.microsoft.com/rest/api/monitor/scheduledqueryrules) and not from Azure portal.
65
57
66
-
For example, if the connector stopped working on 2018-11-01, when you query logs across Application Insights resources and applications data in the workspace, your query would be constructed like the following example:
67
-
68
-
```
69
-
applicationsScoping //this brings data from Application Insights resources
70
-
| where timestamp between (datetime("2018-11-01") .. now())
71
-
| where success == 'False'
72
-
| where duration > 1000
73
-
| union (
74
-
ApplicationInsights //this is Application Insights data in Log Analytics workspace
75
-
| where TimeGenerated < (datetime("2018-12-01")
76
-
| where RequestSuccess == 'False'
77
-
| where RequestDuration > 1000
78
-
| extend duration = RequestDuration //align to Application Insights schema
79
-
| extend timestamp = TimeGenerated //align to Application Insights schema
80
-
| extend name = RequestName //align to Application Insights schema
81
-
| extend resultCode = ResponseCode //align to Application Insights schema
0 commit comments