This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Notifiers

Interaction notifiers

Notifiers are used to send notifications to external services or log interactions to the app log.

Filters

Each notifier will accept a filter configuration option. This option will be compiled into a golang regexp object. What it is executed against depends on the event it is executing against. For HTTPX events it will be the entire HTTP request. This would be a simple example of matching a specific path prefix (GET|POST|HEAD|DELETE|PUT|PATCH|TRACE) /x/.

Be sure to check each handler for mor information on what it’s event supplies for filter matching.

1 - App Log

Log to application log

Structured loggoing output

time=2025-02-26T14:57:03.838-07:00 level=INFO msg="InteractionEvent received" xodbox.pkg=github.com/defektive/xodbox/pkg/notifiers/app_log details="HTTPX: GET /l/face from 127.0.0.1:56407"

Configuration

KeyValues
notifierMust be app_log

2 - Discord

Discord notification

Discord Notification

Configuration

KeyValues
notifierMust be discord
urlWebhook URL
authorUsername to appear in slack. (optional) d
author_imageEmoji code to use for user’s avatar. (optional)
filterGolang regexp.

3 - Slack

Slack notifications

Slack Notification

Configuration

KeyValues
notifierMust be slack
urlWebhook URL
authorUsername to appear in slack. (optional)
author_imageEmoji code to use for user’s avatar. (optional)
channelChannel to post to, can be a user’s ID. (optional)
filterGolang regexp.

4 - Webhook

Generic HTTP Webhook

Post logic is used by the Slack and Discord webhooks.