官术网_书友最值得收藏!

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 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.  
  1. On the overview page, click on Logs in the top menu. This will open the Azure Monitor query editor:
Azure Monitor query editor
  1. 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.
主站蜘蛛池模板: 武城县| 德兴市| 阜康市| 洞口县| 普定县| 嘉鱼县| 尉氏县| 出国| 新津县| 清流县| 屯留县| 遵义市| 梁山县| 河北省| 枣阳市| 合作市| 长治市| 旺苍县| 瑞昌市| 昌乐县| 襄樊市| 吴川市| 汉源县| 沈丘县| 新和县| 无极县| 梨树县| 井陉县| 白沙| 隆德县| 积石山| 安西县| 子洲县| 巧家县| 凭祥市| 通江县| 弋阳县| 宁晋县| 华容县| 南昌市| 桦川县|