Skip to main content

Slack

Posts events to Slack channels via Incoming Webhook or Bot Token.

Details

The Slack output connector supports two authentication methods:

  • Incoming Webhook: The simplest option. Slack generates a unique URL for a specific channel, and Monad posts messages directly to that URL. No Slack app management is required beyond enabling webhooks.
  • Custom App (Bot Token): A Slack bot token grants more flexibility. The bot can be invited to any channel and you control exactly which channel receives messages via the Channel ID setting. This option is better suited for dynamic routing across multiple channels using separate output instances.

Each pipeline event is rendered into a Slack message using a configurable Go template. If no template is provided, a default format is used that includes the organization name, pipeline ID, org ID, output name, and the raw record payload.

The output processes up to 50 messages per batch and respects Slack's rate limits (1 message per second sustained, with short bursts allowed).

Note

This output is NOT designed for high-volume log ingestion. Slack's API rate limits make it best suited for targeted notifications — for example, alerting on high-severity events by combining Monad's conditional routing with a Slack output instance.

Setup

Option 1: Incoming Webhook

Step 1: Create a Slack app

Go to https://api.slack.com/apps and click Create New App. Choose From scratch, give it a name, and select your workspace.

Step 2: Enable Incoming Webhooks

In your app settings, navigate to Incoming Webhooks and toggle it on. Click Add New Webhook to Workspace, select the target channel, and authorize.

Step 3: Copy the Webhook URL

After authorization, Slack displays a Webhook URL of the form:

https://hooks.slack.com/services/...

Use this URL as the Webhook URL secret in Monad.


Option 2: Custom App (Bot Token)

Step 1: Create a Slack app

Go to https://api.slack.com/apps and click Create New App. Choose From scratch, give it a name, and select your workspace.

Step 2: Add OAuth scopes

Navigate to OAuth & Permissions and add the following Bot Token Scope:

  • chat:write — required to post messages to channels.

Step 3: Install the app to your workspace

Click Install to Workspace and authorize. After installation, copy the Bot User OAuth Token (begins with xoxb-).

Step 4: Invite the bot to a channel

In Slack, open the target channel and use /invite @your-app-name to add the bot.

Step 5: Find the Channel ID

Right-click the channel name in Slack's sidebar and select View channel details. The Channel ID is displayed at the bottom of the panel (e.g., C012AB3CD).

Use the bot token as the Bot Token secret and the Channel ID as the Channel ID setting in Monad.

Configuration

The following configuration defines the output's parameters.

Settings

SettingTypeRequiredDescription
Authentication MethodoneOfYesHow to post messages to Slack. Options: 'Incoming Webhook', 'Custom App (Bot Token)'
└── (Incoming Webhook) Webhook URLsecretYesSlack Incoming Webhook URL used to post messages. (https://hooks.slack.com/...).
└── (Custom App) Bot TokensecretYesSlack Bot User OAuth Token (xoxb-...).
└── (Custom App) Channel IDstringYesSlack channel ID to post messages to (e.g. C012AB3CD).
Message TemplatetextNoGo template for the Slack message body. Leave empty to use the default format. See Message Templating below for available variables.

API Examples

The auth_config field is a discriminated union. Set type to select the variant, then provide the matching nested object. Secrets are referenced by their ID (use {"id": "<secret-id>"} instead of an inline value).

Incoming Webhook

{
"settings": {
"auth_config": {
"type": "webhook",
"webhook": {
"webhook_url": {
"id": "<secret-id>"
}
}
},
"message_template": ""
}
}

Custom App (Bot Token)

{
"settings": {
"auth_config": {
"type": "bot_token",
"bot_token": {
"bot_token": {
"id": "<secret-id>"
},
"channel_id": "C012AB3CD"
}
},
"message_template": ""
}
}

Message Templating

When the Message Template setting is left empty, the following default template is used:

Notification Received from Monad for the *{{.OrgName}}* organization
*Pipeline ID:* {{.PipelineID}} *Org ID:* {{.OrgID}} *Output:* {{.OutputName}}
` `` `{{.Record}}` `` `

You can customize the template using any of the following variables:

VariableDescription
{{.OrgName}}Name of the Monad organization
{{.OrgID}}ID of the Monad organization
{{.PipelineID}}ID of the pipeline that produced the event
{{.OutputName}}Name of this output connector instance
{{.Record}}Raw JSON string of the event record
{{.RecordData}}Parsed JSON map — access individual fields with {{index .RecordData "field_name"}}

Example: Custom template using record fields

:warning: *Alert from {{.OrgName}}*
*Severity:* {{index .RecordData "severity"}}
*Source:* {{index .RecordData "source"}}
*Details:* {{.Record}}

Best Practices

  1. Use Incoming Webhook for simplicity: If you only need to post to a single channel, Incoming Webhooks require less setup and no Slack app management beyond initial creation.

  2. Use Bot Token for multi-channel routing: Create multiple Slack output instances (each with a different Channel ID) and use Monad's conditional routing to send events to the appropriate channel based on record content.

  3. Target notifications with conditional routing: Avoid forwarding all events to Slack. Use Monad's conditional routing to filter for high-priority events (e.g., severity == "critical") before sending to this output.

  4. Keep messages concise: Slack has a message size limit. Avoid sending raw records that contain very large payloads; instead, use the {{.RecordData}} variable to extract and display only the relevant fields.

Limitations

  • Slack enforces a sustained rate limit of 1 message per second. Monad handles this automatically, but high-volume pipelines without conditional filtering will encounter delays.
  • Messages are sent as plain text with Slack markdown formatting. Binary data, file attachments, and Block Kit layouts are not supported.
  • Batches are flushed at most every second, so messages may be held for up to 1 second before delivery.
  • The output processes a maximum of 50 messages per batch and a maximum batch data size of 5 MB.