Continuing where we left off in Part I, I will explore how to convert Splunk Alerts and Alert Actions into the Sentinel equivalents.
Alerts
Alerts have the same core problem as everything else in Splunk. They are built on SPL queries and must be converted in order for anything meaningful to be accomplished. This means we have to export the alert object, grab the query, convert it, and finally check that it actually executed in Azure Sentinel and then perform the migration.
Alert Actions
Once you have the alert query converted, the Alert very likely has an action tied to it. Splunk provides several out of the box actions:
Migrating these can be a daunting task if you are doing it manually. Not something I’d suggest trying to do in a large Splunk instance. The first step is to export the alert actions into their JSON form:
And then interrogate the various properties for the Alert Action.
Now that you know how to convert the Alert Actions, you need to find all the alerts that are using the actions so you can create them on the Azure side.
Alerts
Alerts are queries that when the query hits a set of targets, will execute one or more Alert Actions. The first step to migrating these is to export them.
Reviewing the exported JSON object, you will find several interesting properties.
The “QualifiedSearch” and “Search” property is the query that the alert is based off of.
This “Actions” property will tell you what actions have been activated for that alert query.
Once you have the list of activated actions, you have to figure out what information you will need to create the corresponding item in Azure Sentinel or Log Analytics.
In the example above, the logevent action has been enabled for the alert. Review the remainder of the properties, you will find a serialization technique Action.{ActionName}.{PropertyName}.{SubPropertyName0}….
Once you get the hang of it, you can then take the exported data and start to build out the migration tasks that need to occur for each Alert Action Type. Here is a basic mapping based on the items above:
- Email -> Action Group
- LogEvent -> Log to Log Analytics
- Lookup -> Insert into Lookup (more to come on lookup migration later in this series)
- SMS -> Action Group
- Webhook -> Action Group
- Script -> Runbook
- Custom / App -> Logic App / Runbook
Everything above can be accomplished using Azure Management REST queries (I know as I have done the mappings successfully). Some of these have corresponding Azure CLI or PowerShell commands, however some of them do not. So the best approach is to implement everything using simple REST calls.
Splunk to Sentinel Blog Series
- Part I – SPL to KQL, Exporting Objects
- Part II – Alerts and Alert Actions
- Part III – Lookups, Source Types and Indexes
- Part IV – Searches
- Part V – Dashboards and Reports
- Part VI – Users and Permissions
- Part VII – Apps
References:
Splunk, Splunk>, and Turn Data Into Doing are trademarks or registered trademarks of Splunk Inc. in the United States and other countries. All other brand names, product names, or trademarks belong to their respective owners.