> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flashcat.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Alibaba Cloud SLS Integration

> Sync Alibaba Cloud Log Service (SLS) monitoring alert events to Flashduty via webhook for automated alert noise reduction

Sync Alibaba Cloud Log Service (SLS) monitoring alert events to Flashduty via webhook for automated alert noise reduction.

<div class="hide">
  ## In Flashduty

  ***

  You can obtain an integration push URL through either of these two methods:

  ### Using Private Integration

  Choose this simpler option when you don't need to route alerts to different channels.

  <details>
    <summary>Expand</summary>

    1. Go to the Flashduty console, select **Channel**, and enter a specific channel's details page
    2. Select the **Integration** tab, click **Add Integration** to enter the integration page
    3. Choose **Alibaba Cloud SLS** integration and click **Save** to generate a card
    4. Click the generated card to view the **push URL**, copy it for later use, and you're done
  </details>

  ### Using Shared Integration

  Choose this option when you need to route alerts to different channels based on the alert payload information.

  <details>
    <summary>Expand</summary>

    1. Go to the Flashduty console, select **Integration Center=>Alerts** to enter the integration selection page
    2. Select **Alibaba Cloud SLS** integration:
       * **Integration Name**: Define a name for this integration
    3. Configure the default route and select the corresponding channel (after the integration is created, you can go to `Route` to configure more routing rules)
    4. Click **Save** and copy the newly generated **push URL** for later use
    5. Done
  </details>
</div>

## In Alibaba Cloud SLS

***

**Step 1: Configure Webhook**

<div class="md-block">
  1. Log in to your Alibaba Cloud Console, select Log Service (SLS), and choose a Project
  2. Navigate to `Alert`->`Alert Management`->`Webhook Integration` page, click the `Create` button to start editing

  <img src="https://download.flashcat.cloud/flashduty/doc/en/aliyun/sls-1.png" alt="drawing" width="500" />

  3. As shown, select "Generic Webhook" for `Type`, choose POST for `Request Method`, and enter the integration push URL (obtained after saving) for `Request URL`

  <img src="https://download.flashcat.cloud/flashduty/doc/en/aliyun/sls-2.png" alt="drawing" width="500" />

  4. Click the `Confirm` button to save
</div>

**Step 2: Configure Content Template**

<div class="md-block">
  1. Switch to the `Content Template` page and click the `Add` button to start editing
  2. Enter the `Webhook-Custom` configuration, select "Send Individually" for `Send Method`, and copy the following content for `Send Content`:

  ```
  {{ alert | to_json}}
  ```

  <img src="https://download.flashcat.cloud/flashduty/doc/en/aliyun/sls-3.png" alt="drawing" width="500" />

  3. Click the `Confirm` button to save
</div>

**Step 3: Configure Action Policy**

<div class="md-block">
  1. Switch to the `Action Policy` page and click the `Add` button to start editing
  2. Enter the `First Action List` configuration and click to add an `Action Group` node
  3. Select "Generic Webhook" for `Channel`, use previously created objects for `Select Webhook` and `Content Template`, and choose "Any" for `Send Period`

  <img src="https://download.flashcat.cloud/flashduty/doc/en/aliyun/sls-4.png" alt="drawing" width="500" />

  4. Click `Finish` to complete the first action list creation
  5. Click the `Confirm` button to save
</div>

**Step 4: Configure Monitoring Rules**

<div class="md-block">
  1. Switch to the `Rules/Transactions` page and click `Create Alert` button or select an existing alert to update
  2. Enter the `Alert Rule` editing page, `Alert Policy`
  3. Select "Normal Mode" for `Alert Policy` and use the previously created object for `Action Policy`

  <img src="https://download.flashcat.cloud/flashduty/doc/en/aliyun/sls-5.png" alt="drawing" width="500" />

  4. Click the `Confirm` button to save
  5. Repeat these steps for all other rules to push all alerts to Flashduty
</div>

## Status Mapping

***

<div class="md-block">
  Alibaba Cloud SLS monitoring to Flashduty alert severity mapping:

  | Alibaba Cloud SLS | Flashduty | Status   |
  | ----------------- | --------- | -------- |
  | 10                | Critical  | Critical |
  | 8                 | Critical  | Critical |
  | 6                 | Warning   | Warning  |
  | 4                 | Warning   | Warning  |
  | 2                 | Info      | Info     |
</div>
