Outputs
AuditBot supports the following outputs:
Outputs are configured in the outputs
section of the configuration file:
outputs:
- type: "http-output"
# HTTP Output options [...]
- type: "azure-blob-storage"
# Azure blob storage options [...]
...
HTTP
This output will send any matching event to a remote HTTP service.
The payload format will be an multipart/form-data
RFC7578, containing:
- "event" / "event_data.json" in JSON format containing the raw event data.
- "media" containing a (decrypted) file if the event references a media file.
Additionally, three headers are provided:
X-Matrix-Pipe-RoomId
which provides the Matrix RoomID.X-Matrix-Pipe-EventId
which provides the Matrix EventID.X-Matrix-Pipe-Token
which contains the configured token, if set.
The URL will be templated with any contextual keys on the event, so for example
you could provide the roomID as a parameter with https://example.org/your-webhook?roomid=$roomId
type: "http-ouput"
# HTTP url to hit. Can use contextual keys such as $oomId or $eventId.
url: "https://example.org/your-webhook"
# HTTP Method to use. Can be `POST` or `PUT`.
method: "PUT"
identity: "required-to-get-media"
token: "random security token"
# "form-data" or "media-proxy", if media proxy is configured on the http input
media: "form-data"
# Optional. Includes the user's profile if set under "profile" (in form-data) or "profile" in media-proxy mode.
includeProfile: false
# Optional. Add extra keys under "pipe_data" (in form-data) or the "pipe" key in media-proxy mode. Can use contextual values such as $roomId.
additionalProperties:
foo: bar
# Optional. The number of times to retry on failure. Defaults to never
# retrying.
attempts: 5
# Optional. The number of milliseconds to wait before retrying.
attemptsWaitMs: 5000
# Optional. The retry algorithm to use when waiting. Can be "static" to always wait attemptsWaitMs, or "logarithmic".
attemptsAlgorithm: "static"
Azure
This output will send any matching event to a remote Azure Blob Storage service.
type: "azure-blob-storage"
# Connection string to an Azure Storage account. Format: "AccountName:AccountKey"
connectionString: "DefaultEndpointsProtocol=https;AccountName=your-account;AccountKey=your-key;EndpointSuffix=core.windows.net"
# Name of the container in Azure Blob Storage where files will be stored
container: "ess"
# Prefix to use for keys in the container.
keyPrefix: "auditbot/"
File
This output will write any matching event to a file. The file is written in lines of JSONs, containing the raw event data. The file is written to a specified path, and log rotation is handled by the file size and number of files.
type: "file"
file: /storage/matrix-pipeline.log
# The size of the log files
size: 100M
# The number of log files to keep
keep: 3
S3
This output will send any matching event to a remote S3 provider bucket.
type: "s3"
# The name of the S3 bucket to use.
bucket: "my-bucket-name"
# Credentials for accessing the S3 bucket.
credentials:
accessKeyId: "YOUR_ACCESS_KEY_ID"
secretAccessKey: "YOUR_SECRET_ACCESS_KEY"
# Optional. A prefix to add to the key in S3.
keyPrefix: "events/"
# Optional. The region to use (e.g., "eu-north-1").
region: "eu-north-1"
# Optional. Custom S3 endpoint (overrides region).
s3Options:
endpoint: "s3.my_custom_endpoint.com"
SMTP
This output will send any matching event as an email to configured recipients using an SMTP server. The SMTP output sends events as email messages to configured recipients. It supports:
- Custom email templates for subject and body
- Aggregation of messages from the same room before sending
- Filtering events by type
- Configurable SMTP server settings
- Support for email templates with contextual variables like
$sender
,$roomId
,$contentBody
type: "smtp"
# Email configuration
from: "sender@example.com"
recipients:
- "recipient1@example.com"
- "recipient2@example.com"
# Template configuration (optional)
templates:
subject: "Message(s) from $sender"
bodyHeader: "New message from $sender in $roomId\n\n"
bodyContent: "$sender: $contentBody"
# Event type filter (optional)
eventTypeFilter:
- "m.room.message"
- "m.room.encrypted"
# Aggregation configuration (optional)
aggregation:
afterInactiveMs: 60000 # 1 minute
afterMessageCount: 5
# SMTP connection options (advanced)
opts:
# SMTP server configuration
host: "smtp.example.com"
port: 587
auth:
user: "your-username"
pass: "your-password"