Search

[Azure Log Analytics\Azure Monitor] Extracting the values from $webhookdata.

While configuring the alerts and action groups, $webhoodata is used to provide input to the Azure Automation based runbooks.

More precisely it is used when you want to azure automation runbook through Log analytics alerts. While creating alerts you have to define the action group. And this action group is responsible for calling the Runbook.

To receive data from the client, the runbook can accept a single parameter called $WebhookData. This parameter is of a type [object] that contains data that the client includes in the POST request.

The values for the $webhookdata are in JSON format and you can use the following properties to fetch the values from the $webhookdata.

$Webhookbody = $webhookdata | ConvertFrom-Json

$reqbody= $Webhookbody

$alertName = $reqbody.data.AlertRuleName

$Linktosearchresult = $reqbody.data.LinkToSearchResults

$Alert_Description = $reqbody.data.Description

$Search_Query = $reqbody.data.SearchQuery

$alertbody.data.essentials.alertId

$alertbody.data.essentials.alertRule

$alertbody.data.essentials.alertTargetIDs

$alertbody.data.essentials.description

$alertbody.data.alertContext.WorkspaceId

3 views0 comments

Recent Posts

See All