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: event-hubs-hec/README.md
+33-4
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ This repository contains a collection of Azure Functions for:
10
10
* Separating batched events (events in a `records[]` array) into individual events
11
11
* Formatting events in the `event` format for a Splunk HTTP Event Collector
12
12
* Sending event data to Splunk via [HTTP Event Collector](https://docs.splunk.com/Documentation/Splunk/latest/Data/UsetheHTTPEventCollector)
13
-
* Writing event data to a Storage Blob if data cannot sucessfully be sent to Splunk
13
+
* Writing event data to a Storage Blob if data cannot successfully be sent to Splunk
14
14
* The [Splunk Add-on for Microsoft Cloud Services](https://splunkbase.splunk.com/app/3110/) can be utilized to retrieve Storage Blob data
15
15
16
16
## Getting Started
@@ -22,7 +22,7 @@ An HTTP Event Collector receives data pushed from the Azure Functions. Refer to
22
22
An Event Hub Namespace will contain one or more Event Hubs. Refer to the Microsoft documentation for [Event Hub Namespace setup instructions](https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-create).
23
23
24
24
### 3. Send data to an Event Hub
25
-
Microsoft Azure uses [diagnostics settings](https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings) to define data export and destination rules. Each resrouce to be monitored must have a diagnostic setting. Diagnostic settings can be defined using the Azure portal, PowerShell, [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/monitor/diagnostic-settings?view=azure-cli-latest), [Resource Manager templates](https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/resource-manager-diagnostic-settings), REST API, or an Azure Policy.
25
+
Microsoft Azure uses [diagnostics settings](https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings) to define data export and destination rules. Each resource to be monitored must have a diagnostic setting. Diagnostic settings can be defined using the Azure portal, PowerShell, [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/monitor/diagnostic-settings?view=azure-cli-latest), [Resource Manager templates](https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/resource-manager-diagnostic-settings), REST API, or an Azure Policy.
26
26
27
27
*[Sending Azure Activity log data to an Event Hub using the Azure Portal walkthrough](docs/activity_log_diagnostic_settings.md)
28
28
*[Sending Azure Diagnostic logs and metrics to an Event Hub](https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings)
@@ -36,11 +36,40 @@ Microsoft Azure uses [diagnostics settings](https://docs.microsoft.com/en-us/azu
36
36
37
37
Use the "Deploy to Azure" button above to deploy the Azure Functions from this repo to your Azure account. During setup, you will be prompted for the following information:
38
38
39
-
* Event Hub connection string
40
-
* Event Hub consumer group
39
+
* Event Hub Namespace
40
+
* Event Hub consumer group for each hub monitored
41
+
* Splunk sourcetype or sourcetype base for each hub monitored
Functions that collect Azure Active Directory data use a sourcetype base. The category of the Azure Active Directory event is appended to the sourcetype base to construct the full sourcetype.
49
+
50
+
**Example**
51
+
52
+
The default sourcetype base for Azure Active Directory Sign-in and Audit events is `azure:aad`
53
+
54
+
A sign-in event with a category of `SignInLogs` will have a sourcetype of `azure:aad:signinlogs`
55
+
56
+
An audit event with a category of `AuditLogs` will have a sourcetype of `azure:aad:auditlogs`
57
+
58
+
### Diagnostic Logs
59
+
Functions that collect diagnostic log data attempt to construct a sourcetype based on the `resourceId` of the event. The logic for this sourcetype construction can be found in the `getSourceType` function in the [./helpers/splunk.js file](helpers/splunk.js). The following steps are used to construct the sourcetype:
60
+
61
+
* A regular expression is used to extract two groups after the text `/PROVIDERS`
62
+
* Example `/PROVIDERS/`**`MICROSOFT.RESOURCES/DEPLOYMENTS/`**
63
+
* Periods (`.`) and forward slashes (`/`) are replaced with colons (`:`)
64
+
* The event category is appended
65
+
66
+
**Example**
67
+
68
+
An event with a `resourceId` of `/SUBSCRIPTIONS/subscription ID/RESOURCEGROUPS/group/PROVIDERS/MICROSOFT.RESOURCES/DEPLOYMENTS/FAILURE-ANOMALIES-ALERT-RULE-DEPLOYMENT-12345678` will have a sourcetype of `azure:resources:deployments:administrative`
69
+
70
+
If a sourcetype cannot be constructed from the event, the specified default sourcetype entered at setup will be used.
71
+
72
+
44
73
## Securing Azure Function settings
45
74
Microsoft stores the above values as [application settings](https://docs.microsoft.com/en-us/azure/azure-functions/functions-how-to-use-azure-function-app-settings#settings). These settings are stored encrypted, but you may opt to transfer one or more of these settings to a Key Vault. Refer to the following documentation for details on this procedure:
0 commit comments