Configure PagerDuty Webhook Connector
You can configure a webhook connector in the Alert Logic console to send notifications to PagerDuty in near real time. When you set up a notification and subscribe a webhook connector, the connector sends the event to the target URL you configured and creates a message in PagerDuty automatically.
Alert Logic notifications alert you to threats, changes, and scheduled events in your environment so you can respond quickly. From the Alert Logic console, you can subscribe your PagerDuty webhook to receive:
- Incident notifications—Send a message when incidents occur that meet specific criteria, such as escalated incidents.
- Log correlation notifications—Send a message when your log correlation rules trigger an incident or observation.
- Scheduled report notifications—Send a message when Alert Logic generates a scheduled report that is available for download.
Complete the following steps to successfully send messages to PagerDuty:
- Customize the payload template
- Create the PagerDuty webhook connector from the Alert Logic console
- Subscribe your webhook to receive notifications
Customize the payload template
Decide which type of security information that you want Alert Logic to send to PagerDuty: Incident, Observation (of a log correlation), or a Scheduled Report Notification payload.
Alert Logic provides a payload template for an incident and an observation using JQ transformation. A payload template converts the Alert Logic security information to the format expected by PagerDuty. You can add or remove lines in the sample template to meet your workflow requirements and security goals.
For definitions of the Alert Logic variables in the templates and the full JSON that you can use to configure your payload template in JQ or JSON format, see:
Incident payload template
JQ Template
{
"routing_key": "<ROUTING KEY>",
"event_action": "trigger",
"dedup_key": .dedup_hint,
"client": "Alert Logic",
"client_url": "https://console.account.alertlogic.com/",
"links": [{"href": .extra.incidentUrl, "text": "See Incident."}],
"payload": {
"summary": .incident.summary,
"severity": (if .incident.incident_threat_rating == "Critical" then "critical" elif .incident.incident_threat_rating == "High" then "critical" elif .incident.incident_threat_rating == "Medium" then "warning" else "info" end),
"group": "Security",
"class": "security incident",
"source": .victim.value,
"timestamp": .createtime_str
}
}
Observation payload template
JSON Template
{
"routing_key": "<ROUTING KEY>",
"event_action": "trigger",
"dedup_key": .fields.id,
"client": "Alert Logic",
"client_url": "https://console.account.alertlogic.com/",
"payload": {
"summary": .fields.summary,
"severity": (if .fields.severity == "critical" then "critical" elif .fields.severity == "high" then "critical" elif .fields.severity == "medium" then "warning" else "info" end),
"group": "Security",
"class": "security observation",
"source": .fields.path,
"timestamp": .fields.ts | todate,
"payload.custom_details": .fields.keys.message | fromjson
}
}
Create the PagerDuty webhook connector from the Alert Logic console
After you generate the target URL and customize the payload template, the next step is to create the webhook in the Alert Logic console and test the payload.
To create a PagerDuty webhook connector:
- In the Alert Logic console, click the Settings icon (
), and then click Connectors.
- On the Connectors page, click the add icon (
), and then click PagerDuty.
- On the Create a PagerDuty Connector page, type a descriptive name for the webhook connector—for example, "PagerDuty Webhook Connector for Incidents."
- In Target URL, leave the information as is. The field is prepopulated with the URL that PagerDuty requires: https://events.pagerduty.com/v2/enqueue.
- Choose the Payload Type, which is the type of Alert Logic security information that you want to send: Incident, Observation (of a log correlation), or Scheduled Report Notification.
- Choose the format of the payload template you customized earlier: JSON or JQ.
- Enter the payload template that you customized.
- Click TEST to send a test webhook request to the target URL provided. For more information, see Connector test results.
- If your webhook connector sent the test event to the target URL successfully, click SAVE.
Connector test results
If you receive a message that the connector was successfully tested, Alert Logic sends the payload template you configured and populates a message in PagerDuty with sample data. Check PagerDuty to ensure the results are expected, and adjust the payload template if necessary.
If the test is unsuccessful, Alert Logic displays an error message. For server response errors, you can use the error code and message that Alert Logic passes through to troubleshoot the issue. Alert Logic also informs you if your JSON or JQ payload template contains syntax errors.
Subscribe your webhook to receive notifications
After you test and save the connector configuration, the last step is to set up your notification criteria and subscribe the webhook.
You can set up and manage a notification of any type directly from the Notifications page. For more information, see Manage Notifications. You can create notifications from other pages according to notification type:
- For incidents, you can also create a notification from the Incidents page. For more information, see Incident Notifications.
- For observations, you can also create a notification from the Search page (Log Search tab or Correlations tab) during the process of creating the correlation or by editing an existing correlation listed on the Correlations tab. For more information, see Correlations and Notifications and Observation Notifications.
- For scheduled reports, you can also schedule the report and subscribe notification recipients from the Reports page. For more information, see Scheduled Reports and Notifications.
Manage your connectors
You can view the list of connectors and edit or delete an existing one. For more information, see Manage Connectors.