Skip to content

Commit 635cd38

Browse files
committed
add syslog support in webhook mock
1 parent add9eba commit 635cd38

File tree

4 files changed

+641
-604
lines changed

4 files changed

+641
-604
lines changed

docs/site/content/zh/latest/tasks/mock.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,11 @@ proxies:
196196

197197
当前代理支持 HTTP 和 TCP 协议,上面的例子中代理了 MySQL 的 `33060` 端口。
198198

199+
## Webhook
200+
201+
有些场景下,需要定时向服务器发送请求,这时可以使用 Webhook。当前支持的协议包括:
202+
203+
* HTTP
204+
* Syslog
205+
199206
> 更多 URL 中通配符的用法,请参考 https://github.com/gorilla/mux
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
webhooks:
2+
- timer: 3s
3+
name: syslog
4+
request:
5+
protocol: syslog
6+
path: 192.168.123.58:5140
7+
body: |
8+
{
9+
"level": "{{ randEnum "FATAL" "ERROR" "WARNING" "INFO" }}",
10+
"message": "{{ randAlphaNum 10 }}"
11+
}

0 commit comments

Comments
 (0)