-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Implementing Microsoft Azure Architect Technologies: AZ-303 Exam Prep and Beyond
By :

Azure Monitor is now integrated with the features and capabilities that Log Analytics was offering. This also includes creating search queries across the different logs and metrics by using the Kusto Query Language.
To retrieve any type of data from Azure Monitor, a query is required. Whether you are configuring an alert rule, analyzing data in the Azure portal, retrieving data using the Azure Monitor Logs API, or being notified of a particular condition, a query is used.
The following list provides an overview of all of the different ways queries are used by Azure Monitor:
Get-AzOperationalInsightsSearchResults
to retrieve log data from Azure Monitor. You need to create a query for this cmdlet to retrieve the data.In the following section, we are going to create some queries to retrieve data from the logs in Azure Monitor.
To query logs in Azure Monitor, perform the following steps:
https://portal.azure.com
.Figure 1.14 – Azure Monitor query editor
The following query will retrieve the top 10 computers with the most error events over the last day:
Event | where (EventLevelName == “Error”) | where (TimeGenerated > ago(1days)) | summarize ErrorCount = count() by Computer | top 10 by ErrorCount desc
The following query will create a line chart with the processor utilization for each computer from the last week:
Perf | where ObjectName == “Processor” and CounterName == “% Processor Time” | where TimeGenerated between (startofweek(ago(7d)) .. endofweek(ago(7d)) ) | summarize avg(CounterValue) by Computer, bin(TimeGenerated, 5min) | render timechart
Tip
Be careful, Kusto is case sensitive!
Important note
A detailed overview and tutorial on how to get started with the Kusto Query Language are beyond the scope of this book. If you want to find out more about this query language, you can refer to https://docs.microsoft.com/en-us/azure/azure-monitor/log-query/get-started-queries.
Log Analytics provides a powerful tool to explain what is happening within your Azure Infrastructure. Next, we will look at how we can use the built-in networking tools to help identify and resolve communication issues between components.