Skip to content

Commit 9067fe4

Browse files
Azure event grid documentation (#4909)
Co-authored-by: Amee Lepcha <amee.lepcha.ctr@sumologic.com>
1 parent 07fd63d commit 9067fe4

File tree

3 files changed

+184
-10
lines changed

3 files changed

+184
-10
lines changed

docs/integrations/microsoft-azure/azure-event-grid.md

Lines changed: 184 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,200 @@ You must explicitly enable diagnostic settings for each domain, namespaces, cust
3636

3737
When you configure the event hubs source or HTTP source, plan your source category to ease the querying process. A hierarchical approach allows you to make use of wildcards. For example: `Azure/EventGrid/Logs`, `Azure/EventGrid/Metrics`.
3838

39+
### Configure field in field schema
40+
41+
1. [**Classic UI**](/docs/get-started/sumo-logic-ui-classic). In the main Sumo Logic menu, select **Manage Data > Logs > Fields**. <br/>[**New UI**](/docs/get-started/sumo-logic-ui). In the top menu select **Configuration**, and then under **Logs** select **Fields**. You can also click the **Go To...** menu at the top of the screen and select **Fields**.
42+
1. Search for the following fields:
43+
- `tenant_name`. This field is tagged at the collector level. You can get the tenant name using the instructions [here](https://learn.microsoft.com/en-us/azure/active-directory-b2c/tenant-management-read-tenant-name#get-your-tenant-name).
44+
- `location`. The region to which the resource name belongs to.
45+
- `subscription_id`. ID associated with a subscription where the resource is present.
46+
- `resource_group`. The resource group name where the Azure resource is present.
47+
- `provider_name`. Azure resource provider name (for example, Microsoft.Network).
48+
- `resource_type`. Azure resource type (for example, storage accounts).
49+
- `resource_name`. The name of the resource (for example, storage account name).
50+
- `service_type`. Type of the service that can be accessed with a Azure resource.
51+
- `service_name`. Services that can be accessed with an Azure resource (for example, in Azure Event Grid service is Subscriptions).
52+
1. Create the fields if they are not present. Refer to [Manage fields](/docs/manage/fields/#manage-fields).
53+
54+
### Configure field extraction rules
55+
56+
Create the following Field Extraction Rule(s) (FER) for Azure Storage by following the instructions in [Create a Field Extraction Rule](/docs/manage/field-extractions/create-field-extraction-rule/).
57+
58+
#### Azure location extraction FER
59+
60+
```sql
61+
Rule Name: AzureLocationExtractionFER
62+
Applied at: Ingest Time
63+
Scope (Specific Data): tenant_name=*
64+
```
65+
66+
```sql title="Parse Expression"
67+
json "location", "properties.resourceLocation", "properties.region" as location, resourceLocation, service_region nodrop
68+
| replace(toLowerCase(resourceLocation), " ", "") as resourceLocation
69+
| if (!isBlank(resourceLocation), resourceLocation, location) as location
70+
| if (!isBlank(service_region), service_region, location) as location
71+
| if (isBlank(location), "global", location) as location
72+
| fields location
73+
```
74+
75+
#### Resource ID extraction FER
76+
77+
```sql
78+
Rule Name: AzureResourceIdExtractionFER
79+
Applied at: Ingest Time
80+
Scope (Specific Data): tenant_name=*
81+
```
82+
83+
```sql title="Parse Expression"
84+
json "resourceId", "ResourceId" as resourceId1, resourceId2 nodrop
85+
| if (isBlank(resourceId1), resourceId2, resourceId1) as resourceId
86+
| toUpperCase(resourceId) as resourceId
87+
| parse regex field=resourceId "/SUBSCRIPTIONS/(?<subscription_id>[^/]+)" nodrop
88+
| parse field=resourceId "/RESOURCEGROUPS/*/" as resource_group nodrop
89+
| parse regex field=resourceId "/PROVIDERS/(?<provider_name>[^/]+)" nodrop
90+
| parse regex field=resourceId "/PROVIDERS/[^/]+(?:/LOCATIONS/[^/]+)?/(?<resource_type>[^/]+)/(?<resource_name>.+)" nodrop
91+
| parse regex field=resource_name "(?<parent_resource_name>[^/]+)(?:/PROVIDERS/[^/]+)?/(?<service_type>[^/]+)/?(?<service_name>.+)" nodrop
92+
| if (isBlank(parent_resource_name), resource_name, parent_resource_name) as resource_name
93+
| fields subscription_id, location, provider_name, resource_group, resource_type, resource_name, service_type, service_name
94+
```
95+
96+
### Configure metric rules
97+
98+
Create the following metrics rules by following the instructions in [Create a metrics rule](/docs/metrics/metric-rules-editor/#create-a-metrics-rule).
99+
100+
#### Azure observability metadata extraction service level
101+
102+
If this rule already exists, there is no need to create it again.
103+
104+
```sql
105+
Rule Name: AzureObservabilityMetadataExtractionServiceLevel
106+
```
107+
108+
```sql title="Metric match expression"
109+
resourceId=/SUBSCRIPTIONS/*/RESOURCEGROUPS/*/PROVIDERS/*/*/*/*/* tenant_name=*
110+
```
111+
| Fields extracted | Metric rule |
112+
|------------------|----------------|
113+
| subscription_id | $resourceId._1 |
114+
| resource_group | $resourceId._2 |
115+
| provider_name | $resourceId._3 |
116+
| resource_type | $resourceId._4 |
117+
| resource_name | $resourceId._5 |
118+
| service_type | $resourceId._6 |
119+
| service_name | $resourceId._7 |
120+
121+
#### Azure observability metadata extraction event grid level
122+
123+
```sql
124+
Rule Name: AzureObservabilityMetadataExtractionAzureEventGridLevel
125+
```
126+
127+
```sql title="Metric match expression"
128+
resourceId=/SUBSCRIPTIONS/*/RESOURCEGROUPS/*/PROVIDERS/MICROSOFT.EVENTGRID/*/* tenant_name=*
129+
```
130+
| Fields extracted | Metric rule |
131+
|:------------------|:--------------------|
132+
| subscription_id | $resourceId._1 |
133+
| resource_group | $resourceId._2 |
134+
| provider_name | MICROSOFT.EVENTGRID |
135+
| resource_type | $resourceId._3 |
136+
| resource_name | $resourceId._4 |
137+
39138
### Configure metrics collection
40139

41140
In this section, you will configure a pipeline for shipping metrics from Azure Monitor to an Event Hub, on to an Azure Function, and finally to an HTTP Source on a hosted collector in Sumo Logic.
42141

43142
1. [Configure an HTTP Source](/docs/send-data/collect-from-other-data-sources/azure-monitoring/collect-metrics-azure-monitor/#step-1-configure-an-http-source).
44-
2. [Configure and deploy the ARM Template](/docs/send-data/collect-from-other-data-sources/azure-monitoring/collect-metrics-azure-monitor/#step-2-configure-azure-resources-using-arm-template).
45-
3. [Export metrics to Event Hub](/docs/send-data/collect-from-other-data-sources/azure-monitoring/collect-metrics-azure-monitor/#step-3-export-metrics-for-a-particular-resource-to-event-hub). Perform below steps for each Event Grid resource (domain, namespaces, custom topic, and system topic) that you want to monitor.
46-
* Choose `Stream to an event hub` as destination.
47-
* Select `AllMetrics`.
48-
* Use the Event hub namespace created by the ARM template in Step 2 above. You can create a new Event hub or use the one created by ARM template. You can use the default policy `RootManageSharedAccessKey` as the policy name.
143+
1. [Configure and deploy the ARM Template](/docs/send-data/collect-from-other-data-sources/azure-monitoring/collect-metrics-azure-monitor/#step-2-configure-azure-resources-using-arm-template).
144+
1. [Export metrics to Event Hub](/docs/send-data/collect-from-other-data-sources/azure-monitoring/collect-metrics-azure-monitor/#step-3-export-metrics-for-a-particular-resource-to-event-hub). Perform below steps for each Azure Event Grid namespace that you want to monitor.
145+
1. Choose `Stream to an event hub` as destination.
146+
1. Select `AllMetrics`.
147+
1. Use the Event Hub namespace created by the ARM template in Step 2 above. You can create a new Event Hub or use the one created by ARM template. You can use the default policy `RootManageSharedAccessKey` as the policy name.<br/><img src={useBaseUrl('img/send-data/azure-event-grid-metrics.png')} alt="Azure event grid metrics" style={{border: '1px solid gray'}} width="800" />
148+
1. Tag the location field in the source with right location value. <br/><img src={useBaseUrl('img/integrations/microsoft-azure/Azure-Storage-Tag-Location.png')} alt="Azure Event Grid Tag Location" style={{border: '1px solid gray'}} width="400" />
49149

50150
### Configure logs collection
51151

52152
In this section, you will configure a pipeline for shipping diagnostic logs from Azure Monitor to an Event Hub.
53-
153+
#### Diagnostic logs
54154
1. To set up the Azure Event Hubs source in Sumo Logic, refer to [Azure Event Hubs Source for Logs](/docs/send-data/collect-from-other-data-sources/azure-monitoring/ms-azure-event-hubs-source/).
55-
2. To create the Diagnostic settings in Azure portal, refer to the [Azure documentation](https://learn.microsoft.com/en-us/azure/event-grid/enable-diagnostic-logs-topic). Perform below steps for each Event Grid resource (domain, namespaces, custom topic, and system topic) that you want to monitor.
56-
* Choose `Stream to an event hub` as the destination.
57-
* Select `allLogs`.
58-
* Use the Event hub namespace and Event hub name configured in previous step in destination details section. You can use the default policy `RootManageSharedAccessKey` as the policy name.
155+
1. To create the Diagnostic settings in Azure portal, refer to the [Azure documentation](https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=portal#create-diagnostic-settings). Perform below steps for each Azure Event Grid namespace that you want to monitor.
156+
1. Choose `Stream to an event hub` as the destination.
157+
1. Select `allLogs`.
158+
1. Use the Event Hub namespace and Event Hub name configured in previous step in destination details section. You can use the default policy `RootManageSharedAccessKey` as the policy name.
159+
1. Use the Event Hub namespace and Event Hub name configured in the previous step in the destination details section. You can use the default policy `RootManageSharedAccessKey` as the policy name.<br/><img src={useBaseUrl('img/send-data/azure-eventgrid-logs.png')} alt="Azure Event Grid logs" style={{border: '1px solid gray'}} width="800" />
160+
1. Tag the location field in the source with right location value. <br/><img src={useBaseUrl('img/integrations/microsoft-azure/Azure-Storage-Tag-Location.png')} alt="Azure Event Grid Tag Location" style={{border: '1px solid gray'}} width="400" />
161+
162+
#### Activity Logs
163+
164+
To collect activity logs, follow the instructions [here](/docs/integrations/microsoft-azure/audit). Do not perform this step in case you are already collecting activity logs for a subscription.
165+
166+
:::note
167+
Since this source contains logs from multiple regions, make sure that you do not tag this source with the location tag.
168+
:::
169+
170+
## Viewing the Azure Event Grid dashboards
171+
172+
import ViewDashboards from '../../reuse/apps/view-dashboards.md';
173+
174+
<ViewDashboards/>
175+
176+
### Overview
177+
178+
**Azure Event Grid - Overview** dashboard provides details on the performance, authentication, and delivery status of your Azure Event Grid service.
179+
180+
Use this dashboard to:
181+
* Monitor request patterns by location and network access type to optimize resource allocation and improve latency.
182+
* Analyze authentication types to ensure proper security measures are in place and identify potential unauthorized access attempts.
183+
* Track delivery and publish failures by topic to quickly identify and resolve issues affecting event distribution.
184+
* Correlate publish success latency with destination processing duration to optimize end-to-end event handling performance.
185+
186+
<img src={useBaseUrl('https://sumologic-app-data-v2.s3.amazonaws.com/dashboards/AzureEventGrid/Azure-Event-Grid-Overview.png')} alt="Azure Event Grid - Overview" style={{border: '1px solid gray'}} width="800" />
187+
188+
### Administrative Operations
189+
190+
**Azure Event Grid - Administrative Operations** dashboard provides details on the operational activities and status of your Azure Event Grid resources.
191+
192+
Use this dashboard to:
193+
* Monitor the distribution of operation types and their success rates to ensure proper functioning of your Event Grid system.
194+
* Identify potential issues by analyzing the top operations causing errors and correlating them with specific users or applications.
195+
* Track recent write and delete operations to maintain an audit trail of changes made to your Event Grid configuration.
196+
197+
<img src={useBaseUrl('https://sumologic-app-data-v2.s3.amazonaws.com/dashboards/AzureEventGrid/Azure-Event-Grid-Administrative-Operations.png')} alt="Azure Event Grid - Administrative Operations" style={{border: '1px solid gray'}} width="800" />
198+
199+
### Errors
200+
201+
**Azure Event Grid - Errors** dashboard provides details on various error types, failed deliveries, and dropped events in your Azure Event Grid service.
202+
203+
Use this dashboard to:
204+
* Identify the most common error types affecting event publishing and delivery, such as "NotFound" and "Cancelled" errors.
205+
* Analyze trends in delivery attempt failures and correlate them with specific resource groups or topics to pinpoint problematic areas.
206+
* Monitor dropped event counts over time and investigate the reasons behind event drops to improve system reliability.
207+
* Track the top failed topics and delivery destinations to prioritize troubleshooting efforts and optimize event routing.
208+
209+
<img src={useBaseUrl('https://sumologic-app-data-v2.s3.amazonaws.com/dashboards/AzureEventGrid/Azure-Event-Grid-Errors.png')} alt="Azure Event Grid - Errors" style={{border: '1px solid gray'}} width="800" />
210+
211+
### Operations
212+
213+
**Azure Event Grid - Operations** dashboard provides details on the performance and reliability of your Event Grid service, including processing times, success rates, and failure percentages.
214+
215+
Use this dashboard to:
216+
* Monitor the average destination processing duration to identify potential bottlenecks or performance issues in event delivery.
217+
* Track delivery failure percentages over time to quickly spot and address any spikes in unsuccessful event transmissions.
218+
* Analyze the correlation between unmatched event percentages and advanced filter evaluation counts to optimize event routing and filtering.
219+
* Identify trends in publish success latency and failure rates to ensure efficient event publishing and processing.
220+
221+
<img src={useBaseUrl('https://sumologic-app-data-v2.s3.amazonaws.com/dashboards/AzureEventGrid/Azure-Event-Grid-Operations.png')} alt="Azure Event Grid - Operations" style={{border: '1px solid gray'}} width="800" />
222+
223+
### Policy and Recommendations
224+
225+
**Azure Event Grid - Policy and Recommendations** dashboard provides details on policy events and recommendations for your Azure Event Grid resources.
226+
227+
Use this dashboard to:
228+
* Monitor the success and failure rates of policy events to ensure proper configuration and compliance.
229+
* Track and analyze recent recommendations to improve the performance and security of your Event Grid setup.
230+
* Identify trends in policy events and recommendations over time to proactively address potential issues.
231+
232+
<img src={useBaseUrl('https://sumologic-app-data-v2.s3.amazonaws.com/dashboards/AzureEventGrid/Azure-Event-Grid-Policy-and-Recommendations.png')} alt="Azure Event Grid - Policy and Recommendations" style={{border: '1px solid gray'}} width="800" />
59233

60234
## Troubleshooting
61235

Loading
276 KB
Loading

0 commit comments

Comments
 (0)