Skip to main content
Version: 3.0.0

Slack

Slack sink connector

Support Those Engines​

Spark
Flink
SeaTunnel Zeta

Key features​

Description​

Used to send SeaTunnel rows to a Slack channel. Both streaming and batch jobs are supported. The connector first uses the configured OAuth token to look up the channel id, then posts each row as a comma-separated message to that channel through Slack's Web API.

Data Type Mapping​

The Slack connector converts every field of a row to a string with String.valueOf(value) and joins them with commas into a single plain-text message — there is no per-field JSON structure on the wire, so the connector can post any SeaTunnel row regardless of the underlying type.

Sink Options​

nametyperequireddefault valuedescription
webhooks_urlStringYes-Slack incoming webhook URL. The connector checks for this option during initialization; the message write path uses oauth_token and slack_channel to post via the Slack Web API.
oauth_tokenStringYes-Slack OAuth token used to look up channels and post messages through the Slack Web API.
slack_channelStringYes-Slack channel name where rows are posted. The connector resolves this to a channel id via the OAuth token.
common-optionsno-Sink plugin common parameters, please refer to Sink Common Options for details.

webhooks_url [String]​

The Slack incoming webhook URL configured on the target Slack workspace. The connector checks for this option during initialization; the message write path uses oauth_token and slack_channel together with the Slack Web API to look up the channel id and post the row.

oauth_token [String]​

Slack OAuth token with at least chat:write and channels:read (or equivalent) scopes. The token is used to call the conversations.list and chat.postMessage APIs.

slack_channel [String]​

Slack channel name where rows are posted. The connector will resolve the channel name to a channel id through the Slack Web API. The OAuth token must be able to access this channel.

common options​

Sink plugin common parameters, please refer to Sink Common Options for details.

Task Example​

Simple​

sink {
Slack {
webhooks_url = "https://hooks.slack.com/services/xxxxxxxxxxxx/xxxxxxxxxxxx/xxxxxxxxxxxxxxxx"
oauth_token = "xoxp-xxxxxxxxxx-xxxxxxxx-xxxxxxxxx-xxxxxxxxxxx"
slack_channel = "seatunnel-alerts"
}
}

With upstream source​

A simple batch job that forwards rows from a fake source to Slack.

env {
parallelism = 1
job.mode = "BATCH"
}

source {
FakeSource {
schema = {
fields {
user = string
age = int
}
}
rows = [
{ kind = "INSERT", fields = ["huan", 17] }
]
}
}

sink {
Slack {
webhooks_url = "https://hooks.slack.com/services/xxxxxxxxxxxx/xxxxxxxxxxxx/xxxxxxxxxxxxxxxx"
oauth_token = "xoxp-xxxxxxxxxx-xxxxxxxx-xxxxxxxxx-xxxxxxxxxxx"
slack_channel = "seatunnel-alerts"
}
}

The connector sends the row values as one comma-separated Slack message, so the example above produces huan,17 in the configured channel.

Changelog​

Change Log
ChangeCommitVersion
[Improve][Connector-V2] Add nonblank validation for required Slack options (#12178)https://github.com/apache/seatunnel/commit/f6ed9579c3.0.0
[Fix][Connector-V2] Use OAuth token for Slack messages (#12171)https://github.com/apache/seatunnel/commit/d85d8cc733.0.0
[Improve][Connectors-v2] Refactor Slack sink using Factory to create instance (#10514)https://github.com/apache/seatunnel/commit/19b9d5bcc3.0.0
[improve] Slack connector options (#8738)https://github.com/apache/seatunnel/commit/eb706743fe2.3.10
[Feature][Restapi] Allow metrics information to be associated to logical plan nodes (#7786)https://github.com/apache/seatunnel/commit/6b7c53d03c2.3.9
[Improve] Remove use SeaTunnelSink::getConsumedType method and mark it as deprecated (#5755)https://github.com/apache/seatunnel/commit/8de74081002.3.4
[Improve][build] Give the maven module a human readable name (#4114)https://github.com/apache/seatunnel/commit/d7cd6010512.3.1
[Improve][Project] Code format with spotless plugin. (#4101)https://github.com/apache/seatunnel/commit/a2ab1665612.3.1
[Hotfix][OptionRule] Fix option rule about all connectors (#3592)https://github.com/apache/seatunnel/commit/226dc6a1192.3.0
[Feature][Connector-V2][Slack] Add Slack sink connector (#3226)https://github.com/apache/seatunnel/commit/7a836f2d442.3.0