The Webhook Alert integration enables customers to easily integrate LogDNA alerts with 3rd-party services.
For example, if you want to automatically trigger a task in your ticketing system or send a message to you on your chat platform, you can do so via webhooks.
The Webhook Alert integration allows you to configure the webhook’s header, body, and add specific LogDNA tokens to your alerts.
As an example throughout this document, we’ll configure our alerts to create a new issue in Jira after seeing more than 10 matches within 30 seconds.
First, customize the webhook by selecting the HTTP method and adding the webhook URL. In our example, we select the POST HTTP method and add our webhook URL,
https://[YOUR ACCOUNT HERE].atlassian.net/rest/api/2/issue/. The exact URL and HTTP method will depend on the app for which you add the webhook.
Next, set up the headers for the authentication method. The headers depend on the app you are triggering with the webhook.
For our example with Jira, we use API token authentication, which requires us to add an Authorization header.
By default, the webhook body is prepopulated with alert information. Customize the body if needed to conform to the API. If using JSON, use the Validate JSON button to ensure the JSON is valid.
In this case, we want to customize the webhook body to conform to Jira’s Issue API. So, first we configure the body to create a new issue with the view name in the title and more alert information in the issue description. We structure the body according to the Jira REST API for creating issues.
We can validate the body to make sure it has valid JSON via the Validate JSON tool right below the body editor. This tool can catch typos without actually executing the webhook.
Test the webhook with the Test link at the top of the pane. The Test link will trigger the webhook with test data. We use it in our example to attempt to create the issue in our Jira project. Once the test triggers, we can check that the issue has been appropriately created in our Jira project:
Updated 3 months ago