https://github.com/mashiike/slack-webhook-dispatcher
Slack incoming webhook like dispacher
https://github.com/mashiike/slack-webhook-dispatcher
Last synced: 3 months ago
JSON representation
Slack incoming webhook like dispacher
- Host: GitHub
- URL: https://github.com/mashiike/slack-webhook-dispatcher
- Owner: mashiike
- License: mit
- Created: 2025-02-11T11:13:34.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-03-03T20:44:01.000Z (3 months ago)
- Last Synced: 2025-03-09T16:37:23.536Z (3 months ago)
- Language: Go
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# slack-webhook-dispatcher
this app is slack incoming webhook like server, and dispatch to slack incoming webhook with CEL(Common Expression Language) Condition.
## Usage
Slack incoming webhook like dispacher```
Usage of slack-webhook-dispatcher:
-config string
config file path (default "config.jsonnet")
-debug
debug mode
-port int
port number (default 8282)
```### Config file
```jsonnet
local must_env = std.native('must_env');
{
rules: [
{
name: 'rule1',
condition: "payload.Attachments.exists(a, a.Title.contains('[service1]'))",
destination: must_env('SLACK_WEBHOOK_URL_FOR_SERVICE1'),
},
{
name: 'rule2',
condition: "payload.Attachments.exists(a, a.Title.contains('[service2]'))",
destination: must_env('SLACK_WEBHOOK_URL_FOR_SERVICE2'),
},
],
}
```if incoming webhook paylaod is following,
```json
{
"username":"Test",
"attachments":[
{
"color":"#ff3e4b",
"title":"[service1] [development] test exception",
"text":"Occurred at 2025-01-01T25:59:59Z"
}
]
}
```then, this app dispatch to `SLACK_WEBHOOK_URL_FOR_SERVICE1` slack incoming webhook.
## License
MIT