- Microsoft Azure Administrator:Exam Guide AZ-103
- Sjoukje Zaal
- 259字
- 2021-06-24 14:01:59
Querying logs in Azure Monitor
To query logs in Azure monitor, perform the following steps:
- Navigate to the Azure portal by opening https://portal.azure.com.
- In the left-hand menu, select Monitoring 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.
- On the overview page, click on Logs in the top menu. This will open the Azure Monitor query editor:

Azure Monitor query editor
- 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:
-
- This query will retrieve the top 10 computers with the most error events over the past day:
Event | where (EventLevelName == "Error") | where (TimeGenerated > ago(1days)) | summarize ErrorCount = count() by Computer | top 10 by ErrorCount desc
-
- This query will create a line chart with the processor utilization for each computer from 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
A detailed overview and tutorial on how to get started with the Kusto Query Language is 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.
推薦閱讀
- Kubernetes修煉手冊(cè)
- Ansible權(quán)威指南
- Persistence in PHP with the Doctrine ORM
- Learn Helm
- PLC控制系統(tǒng)應(yīng)用與維護(hù)
- macOS效率手冊(cè)
- Linux命令行大全(第2版)
- NetDevOps入門與實(shí)踐
- Python UNIX和Linux系統(tǒng)管理指南
- 分布式系統(tǒng)設(shè)計(jì)實(shí)踐
- μC/OS-III內(nèi)核實(shí)現(xiàn)與應(yīng)用開發(fā)實(shí)戰(zhàn)指南:基于STM32
- Linux操作系統(tǒng)案例教程(第2版)
- 15分鐘!畫出我的漫畫角色:賣萌篇
- Python機(jī)器學(xué)習(xí)系統(tǒng)構(gòu)建(原書第3版)
- Responsive Web Design by Example:Beginner's Guide(Second Edition)