You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/integration-guides/custom-webhook.md
+99-48Lines changed: 99 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,10 @@ description: >-
4
4
This allows advanced rule-based processing with YAML configurations.
5
5
---
6
6
7
+
import Tabs from '@theme/Tabs';
8
+
import TabItem from '@theme/TabItem';
9
+
10
+
7
11
# Custom Webhook
8
12
9
13
| Company | Estimated Time | Vendor Docs | Open Source |
@@ -65,11 +69,87 @@ Define rules in YAML for matching and actions ([see examples below](#examples)).
65
69
### In Your Source Tool
66
70
Configure your tool (e.g., UptimeRobot, AWS SNS, etc.) to send `POST` requests to PagerTree's endpoint URL. The payload will be processed using your YAML rules.
67
71
72
+
## YAML Syntax Reference
73
+
74
+
### Rule Structure
75
+
76
+
```yaml
77
+
preprocess:
78
+
# preprocessors
79
+
# - type: parse_sns
80
+
rules:
81
+
- match:
82
+
# conditions (see your specific tool's payload)
83
+
# log.data.state: "alarm"
84
+
actions:
85
+
- type: create|acknowledge|resolve
86
+
thirdparty_id: "{{log.data.id}}"
87
+
default:
88
+
actions:
89
+
- type: ignore
90
+
```
91
+
92
+
### Preprocessors
93
+
94
+
| Preprocessor | Description |
95
+
| ------------ | ----------- |
96
+
| `parse_json` | Converts a raw string into JSON. |
97
+
| `parse_sns` | Processes AWS SNS payloads and parses the Notification `Message`. |
98
+
99
+
### Match Data
100
+
The shape of the data passed in for you to match on is as follows:
101
+
102
+
```json
103
+
{
104
+
"always": true,
105
+
"log": {
106
+
"data": {
107
+
/* Your tool's payload (a combition of any query parameters and JSON payload) (hash) */
108
+
"key1": "value1",
109
+
"key2": {
110
+
"key3": 123
111
+
}
112
+
// ...
113
+
},
114
+
"headers": {
115
+
/* Headers of the HTTP Request sent by your tool (hash) */
116
+
"Content-Type": "application/json"
117
+
// ...
118
+
},
119
+
"body": "", // Raw body of the payload (string).
120
+
"params": {}, // Raw query parameters (hash).
121
+
"method": "", // The HTTP verb (string).
122
+
"url": "", // The URL that was called (string).
123
+
"remote_ip": , // The IP that made the call (string).
0 commit comments