Skip to content

Latest commit

 

History

History
77 lines (60 loc) · 2.9 KB

app-expression.md

File metadata and controls

77 lines (60 loc) · 2.9 KB
title description services documentationcenter author manager editor ms.assetid ms.service ms.workload ms.tgt_pltfrm ms.devlang ms.topic ms.date ms.author
app() expression in Azure Log Analytics query | Microsoft Docs
The app expression is used in a Log Analytics query to retrieve data from a specific Application Insights app in the same resource group, another resource group, or another subscription.
log-analytics
bwren
carmonm
log-analytics
na
na
na
article
09/10/2018
bwren

app() expression in Log Analytics query

The app expression is used in a Log Analytics query to retrieve data from a specific Application Insights app in the same resource group, another resource group, or another subscription. This is useful to include application data in a Log Analytics query and to query data across multiple applications in an Application Insights query.

Syntax

app(Identifier)

Arguments

  • Identifier: Identifies the app using one of the formats in the table below.
Identifier Description Example
Resource Name Human readable name of the app (AKA "component name") app("fabrikamapp")
Qualified Name Full name of the app in the form: "subscriptionName/resourceGroup/componentName" app('AI-Prototype/Fabrikam/fabrikamapp')
ID GUID of the app app("988ba129-363e-4415-8fe7-8cbab5447518")
Azure Resource ID Identifier for the Azure resource app("/subscriptions/7293b69-db12-44fc-9a66-9c2005c3051d/resourcegroups/Fabrikam/providers/microsoft.insights/components/fabrikamapp")

Notes

  • You must have read access to the application.
  • Identifying an application by its name assumes that it is unique across all accessible subscriptions. If you have multiple applications with the specified name, the query will fail because of the ambiguity. In this case you must use one of the other identifiers.
  • Use the related expression workspace to query across Log Analytics workspaces.

Examples

app("fabrikamapp").requests | count
app("AI-Prototype/Fabrikam/fabrikamapp").requests | count
app("b438b4f6-912a-46d5-9cb1-b44069212ab4").requests | count
app("/subscriptions/7293b69-db12-44fc-9a66-9c2005c3051d/resourcegroups/Fabrikam/providers/microsoft.insights/components/fabrikamapp").requests | count
union 
(workspace("myworkspace").Heartbeat | where Computer contains "Con"),
(app("myapplication").requests | where cloud_RoleInstance contains "Con")
| count  
union 
(workspace("myworkspace").Heartbeat), (app("myapplication").requests)
| where TimeGenerated between(todatetime("2018-02-08 15:00:00") .. todatetime("2018-12-08 15:05:00"))

Next steps