Log Analytics alerts / log alerts missing customized actions to include search results

Shashwati Ramteke (SC-ALT) 6 Reputation points
2021-10-27T15:19:03.317+00:00

Earlier while creating any new Log analytics alerts on a Resource Group. We use to see customized actions. to include webhook payload while calling a function, if we want to include search results from the log analytics query. Shown Below. Somehow am not able to see this check box anymore. Is there a way to still include search results from an alert to the following function call?

144274-image.png

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,812 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Stanislav Zhelyazkov 21,336 Reputation points MVP
    2021-10-28T11:46:45.99+00:00

    Hi,
    The ability to customize the webhook payload was available in legacy API for Log Alerts. More here and here. Recommendation is to migrate to the new API for alerts. Probably the portal was updated to use the new API only or you are using it on workspace that was created after June 2019. If you use the new API (scheduledQueryRules) with version 2018-04-16 you are using Log Alert v1 and if you use with version 2021-02-01-preview you are using Log Alert v2. Both of these APIs support adding custom static data to the webhook payload via customWebhookPayload property. If you use Log Alert v1 search results will be send via the webhook payload. If you use Log Alert v2 only the fields (columns) defined in dimensions will be send via the webhook payload. If you want the full search results with Log Alert v2 in the webhook payload you have links to the Log Analytics query API that you can use to get the data programmatically. I am not sure if customWebhookPayload is exposed trough the Portal but it should be possible to define it if you use the API via ARM template deployments for example. In any case it is best to plan your migration from legacy API to Log Alert v1 or v2.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments