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

# Graylog 告警事件

> 通过 webhook 的方式同步 Graylog 告警事件到 Flashduty On-call

通过 webhook 的方式同步 Graylog 告警事件到 Flashduty On-call。

## 在 Flashduty On-call

您可通过以下两种方式获取集成推送地址，任选其一即可。

### 使用专属集成

如果您只需将告警发往一个协作空间，选择此方式，配置更简单。

> [accordion] 查看专属集成的配置步骤
>
> 1. 进入 Flashduty 控制台，选择 **协作空间**，打开一个协作空间
> 2. 选择 **配置** → **集成数据** → **专属集成**，点击 **新增集成**
> 3. 选择 **Graylog** 集成，点击 **保存**，生成卡片。
> 4. 打开生成的集成卡片，复制 **推送地址**

### 使用共享集成

如果您需要根据告警事件的 Payload 将告警路由到不同协作空间，选择此方式。

> [accordion] 查看共享集成的配置步骤
>
> 1. 进入 Flashduty 控制台，选择 **集成中心 → 告警事件**
> 2. 选择 **Graylog** 集成：
>    * **集成名称**：为当前集成定义一个名称。
> 3. 配置默认路由并选择协作空间；创建后可在 **路由** 中增加更多规则
> 4. 点击 **保存**，复制生成的 **推送地址**

## 在 Graylog 中配置

**1. 在 Graylog 中创建 HTTP Notification**

**操作路径**：Graylog › Alerts › Notifications › Create Notification

| 字段 | 填写 |
| - | - |
| Title（必填） | 自定义名称，例如 `Flashduty`（下一步按该名称选择） |
| Description（可选） | 自定义说明 |
| Notification Type（必填） | `HTTP Notification` |
| URL（必填） | `{integration_url}` |

![drawing](https://fcpub-1301667576.cos.ap-nanjing.myqcloud.com/flashduty/doc/graylog-2.png)

第一次输入该 URL 时，Graylog 要求先把它加入 URL 白名单：

![drawing](https://fcpub-1301667576.cos.ap-nanjing.myqcloud.com/flashduty/doc/graylog-3.png)

点击 Save 保存加白的 URL：

![drawing](https://fcpub-1301667576.cos.ap-nanjing.myqcloud.com/flashduty/doc/graylog-1.png)

保存后，提交 Create。

![drawing](https://fcpub-1301667576.cos.ap-nanjing.myqcloud.com/flashduty/doc/graylog-5.png)

**2. 在 Graylog 的 Event Definition 中使用该 Notification**

**操作路径**：Graylog › Alerts › Event Definitions › 创建或编辑 Event Definition › Notifications

| 字段 | 填写 |
| - | - |
| 告警条件（必填） | 按业务需求配置，此处省略 |
| Notifications（必填） | 点击 Add Notification，选择上一步创建的通道（如 `Flashduty`），点击 Done |

完成后点击下一步直至保存。

![drawing](https://fcpub-1301667576.cos.ap-nanjing.myqcloud.com/flashduty/doc/graylog-4.png)

**3. 触发告警并确认 Flashduty 收到事件**

**操作路径**：Graylog › Alerts › Event Definitions

让 Event Definition 的条件被真实日志满足，等待事件触发。几秒后回到 Flashduty，集成显示 **最新事件时间**，说明配置成功。

## 状态和告警等级

| Graylog `event.priority` | Flashduty |
| - | - |
| 3、4 | Critical |
| 2 | Warning |
| 0、1 | Info |

Graylog 事件优先级为上述取值以外的值时，按 Info 处理。该集成不会收到恢复事件，Graylog 的事件会以其优先级对应的等级进入 Flashduty，不会自动恢复。在接收该集成的协作空间开启超时自动关闭（**Flashduty 控制台 › 协作空间 › 配置 › 设置 › 高级配置**），建议 24 小时，见[超时自动关闭](https://docs.flashduty.com/zh/on-call/channel/create-edit.md)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.