You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-monitor/vm/monitor-virtual-machine-data-collection.md
+37-37Lines changed: 37 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,27 +90,27 @@ For more granular filtering by criteria such as event ID, you can create a custo
90
90
Use the following guidance as a recommended starting point for event collection. Modify the DCR settings to filter unneeded events and add other events depending on your requirements.
91
91
92
92
| Source | Strategy |
93
-
|:---|:---|
93
+
|--------|----------|
94
94
| Windows events | Collect at least **Critical**, **Error**, and **Warning** events for the **System** and **Application** logs to support alerting. Add **Information** events to analyze trends and support troubleshooting. **Verbose** events are rarely useful and typically shouldn't be collected. |
95
95
| Syslog events | Collect at least **LOG_WARNING** events for each facility to support alerting. Add **Information** events to analyze trends and support troubleshooting. **LOG_DEBUG** events are rarely useful and typically shouldn't be collected. |
96
96
97
97
### Sample log queries: Windows events
98
98
99
-
| Query | Description |
100
-
|:---|:---|
101
-
| Event | All Windows events |
102
-
| Event | where EventLevelName == "Error"` |All Windows events with severity of error |
103
-
| Event | summarize count() by Source` |Count of Windows events by source |
104
-
| Event | where EventLevelName == "Error" | summarize count() by Source` |Count of Windows error events by source |
99
+
| Query | Description |
100
+
|---------|-------------|
101
+
|`Event`| All Windows events |
102
+
|`Event`| where EventLevelName == "Error"` |All Windows events with severity of error |
103
+
|`Event`| summarize count() by Source` |Count of Windows events by source |
104
+
|`Event`| where EventLevelName == "Error" | summarize count() by Source` |Count of Windows error events by source |
105
105
106
106
### Sample log queries: Syslog events
107
107
108
-
| Query | Description |
109
-
|:---|:---|
110
-
| Syslog |All Syslogs |
111
-
| Syslog | where SeverityLevel == "error"` |All Syslog records with severity of error |
112
-
| Syslog | summarize AggregatedValue = count() by Computer` |Count of Syslog records by computer |
113
-
| Syslog | summarize AggregatedValue = count() by Facility` |Count of Syslog records by facility |
108
+
| Query | Description |
109
+
|----------|-------------|
110
+
|`Syslog`|All Syslogs |
111
+
|`Syslog`| where SeverityLevel == "error"` |All Syslog records with severity of error |
112
+
|`Syslog`| summarize AggregatedValue = count() by Computer` |Count of Syslog records by computer |
113
+
|`Syslog`| summarize AggregatedValue = count() by Facility` |Count of Syslog records by facility |
114
114
115
115
## Collect performance counters
116
116
Performance data from the client can be sent to either [Azure Monitor Metrics](../essentials/data-platform-metrics.md) or [Azure Monitor Logs](../logs/data-platform-logs.md), and you typically send them to both destinations. If you enabled VM insights, a common set of performance counters is collected in Logs to support its performance charts. You can't modify this set of counters, but you can create other DCRs to collect more counters and send them to different destinations.
@@ -128,37 +128,37 @@ For guidance on creating a DCR to collect performance counters, see [Collect eve
128
128
> You might choose to combine performance and event collection in the same DCR.
129
129
130
130
Destination | Description |
131
-
|:---|:---|
132
-
| Metrics | Host metrics are automatically sent to Azure Monitor Metrics. You can use a DCR to collect client metrics so that they can be analyzed together with [metrics explorer](../essentials/metrics-getting-started.md) or used with [metrics alerts](../alerts/alerts-create-new-alert-rule.md?tabs=metric). This data is stored for 93 days. |
131
+
|------------|-------------|
132
+
| Metrics | Host metrics are automatically sent to Azure Monitor Metrics. You can use a DCR to collect client metrics so that they can be analyzed together with [metrics explorer](../essentials/metrics-getting-started.md) or used with [metrics alerts](../alerts/alerts-create-new-alert-rule.md?tabs=metric). This data is stored for 93 days. |
133
133
| Logs | Performance data stored in Azure Monitor Logs can be stored for extended periods. The data can be analyzed along with your event data by using [log queries](../logs/log-query-overview.md) with [Log Analytics](../logs/log-analytics-overview.md) or [log query alerts](../alerts/alerts-create-new-alert-rule.md?tabs=log). You can also correlate data by using complex logic across multiple machines, regions, and subscriptions.<br><br>Performance data is sent to the following tables:<br>VM insights - [InsightsMetrics](/azure/azure-monitor/reference/tables/insightsmetrics)<br>Other performance data - [Perf](/azure/azure-monitor/reference/tables/perf)|
134
134
135
135
### Sample log queries
136
136
The following samples use the `Perf` table with custom performance data. For information on performance data collected by VM insights, see [How to query logs from VM insights](../vm/vminsights-log-query.md#performance-records).
137
137
138
-
| Query | Description |
139
-
|:---|:---|
140
-
| Perf | All Performance data |
141
-
| Perf | where Computer == "MyComputer"` |All Performance data from a particular computer |
142
-
| Perf | where CounterName == "Current Disk Queue Length"` |All Performance data for a particular counter |
143
-
| Perf | where ObjectName == "Processor" and CounterName == "% Processor Time" and InstanceName == "_Total" | summarize AVGCPU = avg(CounterValue) by Computer` |Average CPU Utilization across all computers |
144
-
| Perf | where CounterName == "% Processor Time" | summarize AggregatedValue = max(CounterValue) by Computer` |Maximum CPU Utilization across all computers |
145
-
| Perf | where ObjectName == "LogicalDisk" and CounterName == "Current Disk Queue Length" and Computer == "MyComputerName" | summarize AggregatedValue = avg(CounterValue) by InstanceName` |Average Current Disk Queue length across all the instances of a given computer |
146
-
| Perf | where CounterName == "Disk Transfers/sec" | summarize AggregatedValue = percentile(CounterValue, 95) by Computer` |95th Percentile of Disk Transfers/Sec across all computers |
147
-
| Perf | where CounterName == "% Processor Time" and InstanceName == "_Total" | summarize AggregatedValue = avg(CounterValue) by bin(TimeGenerated, 1h), Computer` |Hourly average of CPU usage across all computers |
148
-
| Perf | where Computer == "MyComputer" and CounterName startswith_cs "%" and InstanceName == "_Total" | summarize AggregatedValue = percentile(CounterValue, 70) by bin(TimeGenerated, 1h), CounterName` | Hourly 70 percentile of every % percent counter for a particular computer |
149
-
| Perf | where CounterName == "% Processor Time" and InstanceName == "_Total" and Computer == "MyComputer" | summarize ["min(CounterValue)"] = min(CounterValue), ["avg(CounterValue)"] = avg(CounterValue), ["percentile75(CounterValue)"] = percentile(CounterValue, 75), ["max(CounterValue)"] = max(CounterValue) by bin(TimeGenerated, 1h), Computer` |Hourly average, minimum, maximum, and 75-percentile CPU usage for a specific computer |
150
-
| Perf | where ObjectName == "MSSQL$INST2:Databases" and InstanceName == "master"` | All Performance data from the Database performance object for the master database from the named SQL Server instance INST2. |
138
+
| Query | Description |
139
+
|--------|-------------|
140
+
|`Perf`| All Performance data |
141
+
|`Perf`| where Computer == "MyComputer"` |All Performance data from a particular computer |
142
+
|`Perf`| where CounterName == "Current Disk Queue Length"` |All Performance data for a particular counter |
143
+
|` Perf`| where ObjectName == "Processor" and CounterName == "% Processor Time" and InstanceName == "_Total" | summarize AVGCPU = avg(CounterValue) by Computer` |Average CPU Utilization across all computers |
144
+
|`Perf`| where CounterName == "% Processor Time" | summarize AggregatedValue = max(CounterValue) by Computer` |Maximum CPU Utilization across all computers |
145
+
|`Perf`| where ObjectName == "LogicalDisk" and CounterName == "Current Disk Queue Length" and Computer == "MyComputerName" | summarize AggregatedValue = avg(CounterValue) by InstanceName` |Average Current Disk Queue length across all the instances of a given computer |
146
+
|`Perf`| where CounterName == "Disk Transfers/sec" | summarize AggregatedValue = percentile(CounterValue, 95) by Computer` |95th Percentile of Disk Transfers/Sec across all computers |
147
+
|`Perf`| where CounterName == "% Processor Time" and InstanceName == "_Total" | summarize AggregatedValue = avg(CounterValue) by bin(TimeGenerated, 1h), Computer` |Hourly average of CPU usage across all computers |
148
+
|`Perf`| where Computer == "MyComputer" and CounterName startswith_cs "%" and InstanceName == "_Total" | summarize AggregatedValue = percentile(CounterValue, 70) by bin(TimeGenerated, 1h), CounterName` | Hourly 70 percentile of every % percent counter for a particular computer |
149
+
|`Perf`| where CounterName == "% Processor Time" and InstanceName == "_Total" and Computer == "MyComputer" | summarize ["min(CounterValue)"] = min(CounterValue), ["avg(CounterValue)"] = avg(CounterValue), ["percentile75(CounterValue)"] = percentile(CounterValue, 75), ["max(CounterValue)"] = max(CounterValue) by bin(TimeGenerated, 1h), Computer` |Hourly average, minimum, maximum, and 75-percentile CPU usage for a specific computer |
150
+
|`Perf`| where ObjectName == "MSSQL$INST2:Databases" and InstanceName == "master"` | All Performance data from the Database performance object for the master database from the named SQL Server instance INST2. |
151
151
152
152
## Collect text logs
153
153
Some applications write events written to a text log stored on the virtual machine. Create a [custom table and DCR](../agents/data-collection-text-log.md) to collect this data. You define the location of the text log, its detailed configuration, and the schema of the custom table. There's a cost for the ingestion and retention of this data in the workspace.
154
154
155
155
### Sample log queries
156
156
The column names used here are examples only. The column names for your log will most likely be different.
157
157
158
-
| Query | Description |
159
-
|:---|:---|
160
-
| MyApp_CL | summarize count() by code` | Count the number of events by code. |
161
-
| MyApp_CL | where status == "Error" | summarize AggregatedValue = count() by Computer, bin(TimeGenerated, 15m)` | Create an alert rule on any error event. |
158
+
| Query | Description |
159
+
|------------|-------------|
160
+
|`MyApp_CL`| summarize count() by code` | Count the number of events by code. |
161
+
|`MyApp_CL`| where status == "Error" | summarize AggregatedValue = count() by Computer, bin(TimeGenerated, 15m)` | Create an alert rule on any error event. |
162
162
163
163
## Collect IIS logs
164
164
IIS running on Windows machines writes logs to a text file. Configure IIS log collection by using [Collect IIS logs with Azure Monitor Agent](../agents/data-collection-iis.md). There's a cost for the ingestion and retention of this data in the workspace.
@@ -167,10 +167,10 @@ Records from the IIS log are stored in the [W3CIISLog](/azure/azure-monitor/refe
167
167
168
168
### Sample log queries
169
169
170
-
| Query | Description |
171
-
|:---|:---|
172
-
| W3CIISLog | where csHost=="www.contoso.com" | summarize count() by csUriStem` | Count the IIS log entries by URL for the host www.contoso.com.|
173
-
| W3CIISLog | summarize sum(csBytes) by Computer` | Review the total bytes received by each IIS machine. |
170
+
| Query | Description |
171
+
|-------------|-------------|
172
+
|`W3CIISLog`| where csHost=="www.contoso.com" | summarize count() by csUriStem` | Count the IIS log entries by URL for the host www.contoso.com.|
173
+
|`W3CIISLog`| summarize sum(csBytes) by Computer` | Review the total bytes received by each IIS machine. |
174
174
175
175
## Monitor a service or daemon
176
176
To monitor the status of a Windows service or Linux daemon, enable the [Change Tracking and Inventory](../../automation/change-tracking/overview.md) solution in [Azure Automation](../../automation/automation-intro.md).
@@ -185,7 +185,7 @@ For different options to enable the Change Tracking solution on your virtual mac
185
185
When you enable Change Tracking and Inventory, two new tables are created in your Log Analytics workspace. Use these tables for logs queries and log query alert rules.
186
186
187
187
| Table | Description |
188
-
|:---|:---|
188
+
|-------|-------------|
189
189
|[ConfigurationChange](/azure/azure-monitor/reference/tables/configurationdata)| Changes to in-guest configuration data |
190
190
|[ConfigurationData](/azure/azure-monitor/reference/tables/configurationdata)| Last reported state for in-guest configuration data |
0 commit comments