Skip to content

Commit d6f772c

Browse files
committed
Update README.md
1 parent 19ac5ea commit d6f772c

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

event-hubs-hec/README.md

+33-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This repository contains a collection of Azure Functions for:
1010
* Separating batched events (events in a `records[]` array) into individual events
1111
* Formatting events in the `event` format for a Splunk HTTP Event Collector
1212
* 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
1414
* The [Splunk Add-on for Microsoft Cloud Services](https://splunkbase.splunk.com/app/3110/) can be utilized to retrieve Storage Blob data
1515

1616
## Getting Started
@@ -22,7 +22,7 @@ An HTTP Event Collector receives data pushed from the Azure Functions. Refer to
2222
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).
2323

2424
### 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.
2626

2727
* [Sending Azure Activity log data to an Event Hub using the Azure Portal walkthrough](docs/activity_log_diagnostic_settings.md)
2828
* [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
3636

3737
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:
3838

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
42+
* Note: see section below about sourcetypes
4143
* Splunk [HTTP Event Collector](https://docs.splunk.com/Documentation/Splunk/latest/Data/UsetheHTTPEventCollector) Endpoint
4244
* Splunk [HTTP Event Collector](https://docs.splunk.com/Documentation/Splunk/latest/Data/UsetheHTTPEventCollector) Token
4345

46+
## Splunk Sourcetypes
47+
### Azure Active Directory Sourcetypes
48+
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+
4473
## Securing Azure Function settings
4574
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:
4675

0 commit comments

Comments
 (0)