Send messages to Slack

The following section assumes that you already have Hotrod (possibly deployed on some Bboxes) up and running, for more information related to getting up and running see our Getting Started Guide.

From time to time it is necessary to send notifications to external services such as Slack in order to alert or inform key persons. Sending a message to Slack using Hotrod is as simple as using the pipe below, the only requirement is to obtain the correct Slack url following the relevant instructions.

name: slack
context:
  slack_token: 'https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX'
input:
  exec:
    command: echo '{}'
    json: true
    interval: 30s
actions:
  - time:
      output-field: time
  - add:
      output-fields:
        - text: "Hello Slack, your local time is ${time}"
  - filter:
      schema:
        - text
output:
   http-post:
       url: '{{ slack_url }}'