Slack

Send critical alerts to a monitored Slack channel

Overview

The Slack transport provides the ability to send alerts to a Slack channel which can drive further processing.

Property placeholders are used to provide additional context to the message. Properties need to be present within the final event generated by the select projection.

Example & DSL attributes

This example configures the Slack transport to send alerts to the iot_sensor_alert channel.

slack publisher:
  name: iot_sensor_alert
  api token: xoxb-xxxxxx-xxxxxx-xxxxxx-xxxxxx
  channels:
    - iot_sensor_alerts
  message template: Toggling sensor {sensorId} humidifier valve state to {valve_signal} (1:ON | 0:OFF)
  inform users:
    -U0783OPG7CL

As an example the above configuration upon receiving the following event from a processing stream:

emit:
    select: "sensorId, valve_signal"

Would generate and publish the message below on to the iot_sensor_alerts slack channel

// Created message
2025-02-19 14:34:46 - Toggling sensor 1001 humidifier valve state to 1 (1:ON | 0:OFF)
@Lyndon

Attributes schema

Attribute
Description
Data Type
Required

name

Logical name for the configuration

String

api token

Slack api bot token. This is provided either within the configuration file or as the SLACK_API_TOKEN environment variable.

String

user email

This is the user email to use to send messages to a channel is provided

String

channels

List of channels to publish message on to

List<String>

message template

Message template that applies the selected attributes from an emitted event to the message i.e. {sensorId} is replaced by the corresponding value in the event.

String

inform users

List of slack member ids to add to the message. Member Ids are found on the user profile.

List<String>

Last updated

Was this helpful?