Skip to content

Commit 3be5eac

Browse files
authored
Adding Resource specific table queries for Azure Event Hubs
1 parent d211d46 commit 3be5eac

File tree

1 file changed

+44
-3
lines changed

1 file changed

+44
-3
lines changed

articles/event-hubs/monitor-event-hubs.md

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ If you use **Azure Storage** to store the diagnostic logging information, the in
4848
If you use **Azure Event Hubs** to store the diagnostic logging information, the information is stored in Event Hubs instances named **insights-logs-operationlogs** and **insights-metrics-pt1m**. You can also select an existing event hub except for the event hub for which you are configuring diagnostic settings.
4949

5050
### Log Analytics
51-
If you use **Log Analytics** to store the diagnostic logging information, the information is stored in tables named **AzureDiagnostics** and **AzureMetrics**.
51+
If you use **Log Analytics** to store the diagnostic logging information, the information is stored in tables named **AzureDiagnostics** / **AzureMetrics** or **resource specific tables**
5252

5353
> [!IMPORTANT]
5454
> Enabling these settings requires additional Azure services (storage account, event hub, or Log Analytics), which may increase your cost. To calculate an estimated cost, visit the [Azure pricing calculator](https://azure.microsoft.com/pricing/calculator).
@@ -88,6 +88,8 @@ For a detailed reference of the logs and metrics, see [Azure Event Hubs monitori
8888
8989
Following are sample queries that you can use to help you monitor your Azure Event Hubs resources:
9090

91+
### [AzureDiagnostics](#tab/AzureDiagnostics)
92+
9193
+ Get errors from the past seven days
9294

9395
```Kusto
@@ -105,8 +107,6 @@ Following are sample queries that you can use to help you monitor your Azure Eve
105107
| where ResourceProvider =="MICROSOFT.EVENTHUB"
106108
| where Category == "RuntimeAuditLogs"
107109
```
108-
109-
110110
+ Get access attempts to a key vault that resulted in "key not found" error.
111111
112112
```Kusto
@@ -131,9 +131,30 @@ Following are sample queries that you can use to help you monitor your Azure Eve
131131
| where ResourceProvider == "MICROSOFT.EVENTHUB"
132132
| where Category == "ArchiveLogs"
133133
| summarize count() by "failures", "durationInSeconds"
134+
```
135+
136+
### [Resource Specific Table](#tab/Resourcespecifictable)
134137
138+
139+
+ Get Operational Logs for event hub resource for last 7 days
140+
141+
```Kusto
142+
AZMSOperationalLogs
143+
| where Timegenerated > ago(7d)
144+
| where Provider == "EVENTHUB"
145+
| where resourceId == "<Resource Id>" // Replace your resource Id
135146
```
136147
148+
+ Get capture logs for event hub for last 7 days
149+
150+
```Kusto
151+
AZMSArchiveLogs
152+
| where EventhubName == "<Event Hub Name>" //Enter event hub entity name
153+
| where TimeGenerated > ago(7d)
154+
```
155+
156+
157+
---
137158
## Use runtime logs
138159
139160
Azure Event Hubs allows you to monitor and audit data plane interactions of your client applications using runtime audit logs and application metrics logs.
@@ -161,12 +182,22 @@ To collect sample runtime audit logs in your Event Hubs namespace, you can publi
161182
### Analyze runtime audit logs
162183
You can analyze the collected runtime audit logs using the following sample query.
163184
185+
### [AzureDiagnostics](#tab/AzureDiagnosticsforRuntimeAudit)
186+
164187
```kusto
165188
AzureDiagnostics
166189
| where TimeGenerated > ago(1h)
167190
| where ResourceProvider == "MICROSOFT.EVENTHUB"
168191
| where Category == "RuntimeAuditLogs"
169192
```
193+
### [Resource Specific Table](#tab/ResourcespecifictableforRuntimeAudit)
194+
195+
```kusto
196+
AZMSRuntimeAuditLogs
197+
| where TimeGenerated > ago(1h)
198+
| where Provider == "EVENTHUB"
199+
```
200+
---
170201
Up on the execution of the query you should be able to obtain corresponding audit logs in the following format.
171202
:::image type="content" source="./media/monitor-event-hubs/runtime-audit-logs.png" alt-text="Image showing the result of a sample query to analyze runtime audit logs." lightbox="./media/monitor-event-hubs/runtime-audit-logs.png":::
172203

@@ -176,12 +207,22 @@ By analyzing these logs you should be able to audit how each client application
176207
### Analyze application metrics
177208
You can analyze the collected application metrics logs using the following sample query.
178209

210+
### [AzureDiagnostics](#tab/AzureDiagnosticsforAppMetrics)
211+
179212
```kusto
180213
AzureDiagnostics
181214
| where TimeGenerated > ago(1h)
182215
| where Category == "ApplicationMetricsLogs"
183216
```
184217

218+
### [Resource Specific Table](#tab/ResourcespecifictableforAppMetrics)
219+
220+
```kusto
221+
AZMSApplicationMetricLogs
222+
| where TimeGenerated > ago(1h)
223+
| where Provider == "EVENTHUB"
224+
```
225+
---
185226
Application metrics includes the following runtime metrics.
186227
:::image type="content" source="./media/monitor-event-hubs/application-metrics-logs.png" alt-text="Image showing the result of a sample query to analyze application metrics." lightbox="./media/monitor-event-hubs/application-metrics-logs.png":::
187228

0 commit comments

Comments
 (0)