Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Implementing Microsoft Azure Architect Technologies: AZ-303 Exam Prep and Beyond - Second Edition

You're reading from  Implementing Microsoft Azure Architect Technologies: AZ-303 Exam Prep and Beyond - Second Edition

Product type Book
Published in Dec 2020
Publisher Packt
ISBN-13 9781800568570
Pages 548 pages
Edition 2nd Edition
Languages
Authors (2):
Brett Hargreaves Brett Hargreaves
Profile icon Brett Hargreaves
Sjoukje Zaal Sjoukje Zaal
Profile icon Sjoukje Zaal
View More author details
Toc

Table of Contents (25) Chapters close

Preface 1. Section 1: Implement and Monitor Azure Infrastructure
2. Chapter 1: Implementing Cloud Infrastructure Monitoring 3. Chapter 2: Creating and Configuring Storage Accounts 4. Chapter 3: Implementing and Managing Virtual Machines 5. Chapter 4: Implementing and Managing Virtual Networking 6. Chapter 5: Creating Connectivity between Virtual Networks 7. Chapter 6: Managing Azure Active Directory (Azure AD) 8. Chapter 7: Implementing Multi-Factor Authentication (MFA) 9. Chapter 8: Implementing and Managing Hybrid Identities 10. Section 2: Implement Management and Security Solutions
11. Chapter 9: Managing Workloads in Azure 12. Chapter 10: Implementing Load Balancing and Networking Security 13. Chapter 11: Implementing Azure Governance Solutions 14. Section 3: Implement Solutions for Apps
15. Chapter 12: Creating Web Apps Using PaaS and Serverless 16. Chapter 13: Designing and Developing Apps for Containers 17. Chapter 14: Implementing Authentication 18. Section 4: Implement and Manage Data Platforms
19. Chapter 15: Developing Solutions that Use Cosmos DB Storage 20. Chapter 16: Developing Solutions that Use a Relational Database 21. Chapter 17: Mock Exam Questions
22. Chapter 18: Mock Exam Answers
23. Assessments 24. Other Books You May Enjoy

Utilizing log search query functions

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:

  • Portal: From the Azure portal, interactive analysis of log data can be performed. There, you can create and edit queries and analyze the results in a variety of formats and visualizations.
  • Dashboards: The results of a query can be pinned to a dashboard. This way, results can be visualized and shared with other users.
  • Views: By using the View Designer in Azure Monitor, you can create custom views of your data. This data is provided by queries as well.
  • Alert rules: Alert rules are also made up of queries.
  • Export: Exports of data to Excel or Power BI are created with queries. The query defines the data to export.
  • Azure Monitor Logs API: The Azure Monitor Logs API allows any REST API client to retrieve log data from the workspace. The API request includes a query to retrieve the data.
  • PowerShell: You can run a PowerShell script from command line or an Azure Automation runbook that uses 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.

Querying logs in Azure Monitor

To query logs in Azure Monitor, perform the following steps:

  1. Navigate to the Azure portal by opening https://portal.azure.com.
  2. In the left-hand menu, select Monitor to open the Azure Monitor overview blade. Under Insights, select More. This will open the Log Analytics workspace that we created in the previous step.
  3. On the overview page, click on Logs in the top menu. This will open the Azure Monitor query editor:
    Figure 1.14 – Azure Monitor query editor

    Figure 1.14 – Azure Monitor query editor

  4. Here, you can select some default queries. They are displayed at the bottom part of the screen. There are queries for retrieving unavailable computers, the last heartbeat of a computer, and much more. Add the following queries to the query editor window to retrieve data:

    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.

You have been reading a chapter from
Implementing Microsoft Azure Architect Technologies: AZ-303 Exam Prep and Beyond - Second Edition
Published in: Dec 2020 Publisher: Packt ISBN-13: 9781800568570
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime