# Discord Destination

## Overview

Destinations are integrations that receive alerts from rules, policies, system health notifications, and rule errors. Panther supports configuring Discord as a destination where you will receive alerts.

## How to configure Panther alerts to send to Discord

### Prerequisites

* In your Discord server, create a new channel or confirm which existing channel you want to send Panther alerts to.

### Step 1: Obtain your Discord channel's webhook URL

Follow these steps for the Discord channel you wish to send alerts to:

1. In Discord, select the Server. Under *Text Channels*, locate the Discord channel you want to use. Select **Edit Channel (gear icon)**.

   <figure><img src="https://4011785613-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LgdiSWdyJcXPahGi9Rs-2910905616%2Fuploads%2Fgit-blob-264b1d6339c2ddd53d46d61ca54e94aa7f5be557%2FScreenshot%202024-02-21%20at%203.23.53%E2%80%AFPM.png?alt=media" alt="In Discord, the gear icon next to &#x22;#general&#x22;, under &#x22;Text Channels&#x22; is highlighted."><figcaption></figcaption></figure>
2. Click **Integrations** and select **Create Webhook**.

   <figure><img src="https://4011785613-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LgdiSWdyJcXPahGi9Rs-2910905616%2Fuploads%2Fgit-blob-9a89f6278013051fe584413bcbefaa9c0001722d%2Fimage.png?alt=media" alt="In Discord on the Integrations page, there is a button in the center of the page labeled &#x22;Create Webhook.&#x22;"><figcaption></figcaption></figure>
3. Discord will create a new webhook for with a default name. Click on the webhook (in the example below, **Spidey Bot**) to expand it and view the details.

   <figure><img src="https://4011785613-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LgdiSWdyJcXPahGi9Rs-2910905616%2Fuploads%2Fgit-blob-35b28fbcbc762de9f12124c1aa1dd4572028c079%2Fimage.png?alt=media" alt="In Discord under the &#x22;New Webhook&#x22; button, there is a webhook called &#x22;Spidey Bot.&#x22;"><figcaption></figcaption></figure>
4. Optionally, rename the webhook then click **Save Changes**.
   * The webhook name is shown as the sender in your channel when alerts are delivered.

     <figure><img src="https://4011785613-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LgdiSWdyJcXPahGi9Rs-2910905616%2Fuploads%2Fgit-blob-ad1f11eacfee81ae00a695c00ddb07852c2c61db%2Fimage.png?alt=media" alt="In Discord, the webhook details are expanded. &#x22;My Discord Destination&#x22; has been typed into the &#x22;Name&#x22; field."><figcaption></figcaption></figure>
5. Click **Copy Webhook URL**. You will need this value in the next step.

For more information on using webhooks in Discord, please see [Discord's webhook resource documentation](https://discord.com/developers/docs/resources/webhook).

### Step 2: Create the webhook integration in Panther

1. In the Panther Console, navigate to **Configure > Alert Destinations.**
2. Click **+ Add your first Destination**.
   * If you have already created Destinations, click **Create New** in the upper right side of the page to add a new Destination.
3. Click **Discord**.
4. On the "Configure Your Webhook Destination page", fill out the form:
   * **Display Name:** Enter a descriptive name.
   * **Discord Webhook URL**: Enter the Discord webhook URL you obtained in Step 1.
     * Your webhook URL will have the following format: `https://discord.com/api/webhooks/<token-string>`
   * **Severity**: Select the severity level of alerts to send to this Destination.
   * **Alert Types**: Select the alert types to send to this Destination.
   * **Log Type**: By default, we will send alerts from all log types. Specify log types here if you want to only send alerts from specific log types.
   * **Allow Manual Dispatch**: Set this toggle ON if you'd like to be able to [manually dispatch alerts](https://docs.panther.com/alerts#manual-alert-dispatch) to this destination.\
     ![](https://4011785613-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LgdiSWdyJcXPahGi9Rs-2910905616%2Fuploads%2Fgit-blob-fcc3dee8351f6f665158ea2e33f001877c6b653f%2Fimage.png?alt=media)
5. Click **Add Destination**.
6. Click **Send Test Alert** to make sure everything works correctly.
   * A test event should now exist in your Discord channel.
7. Click **Finish Setup.**

## Generate a test alert

Click **Test Alert** to generate an alert and send to Discord. The payload of the alert is seen below:

```json
{"id":"Test.Alert","createdAt":"2022-04-26T03:17:32.099054303Z","severity":"INFO","type":"RULE","link":"https://domain.runpanther.net","title":"This is a Test Alert","name":"Test Alert","alertId":"Test.Alert","alertContext":{},"description":"This is a Test Alert","runbook":"Stuck? Check out our docs: https://docs.runpanther.io","tags":["test"],"version":"1"}
```

Once the alert is received by Discord, a message is sent to a channel in Discord:

<figure><img src="https://4011785613-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LgdiSWdyJcXPahGi9Rs-2910905616%2Fuploads%2Fgit-blob-01a14dd2f63b488d40855a761ab80df934854887%2FScreenshot%202024-02-20%20at%209.48.45%E2%80%AFAM.png?alt=media" alt="The channel in Discord contains a test alert."><figcaption></figcaption></figure>
