# slack: Send alerts and notifications to a Slack channel

The `slack()` destination driver sends messages to a [Slack](<https://slack.com/>) channel using the Slack Web API. For the list of available optional parameters, see [Slack destination options](../../docs/axosyslog-core/chapter-destinations/destination-slack/reference-destination-slack/index.md). This destination is available in version 3.19 and later.

## Declaration:
```
    @include "scl.conf"
    # ...
    
    destination d_slack {
      slack(
        hook-url("https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX")
      );
    };
    
```

The driver allows you to modify nearly every field of the HTTP request. For details, see the [Slack API documentation](<https://api.slack.com/docs>).

You can use the `proxy()` option to configure the HTTP driver in all HTTP-based destinations to use a specific HTTP proxy that is independent from the proxy configured for the system.

By default, the `throttle()` option is set to 1, because Slack has a 1 message/second limit on Webhooks. It can allow more message in short bursts, so you can set it to 0, if you only expect messages in a short period of time. For details, see the [Web API rate limiting in the Slack documentation](<https://api.slack.com/apis/rate-limits>).

To use this destination, the `scl.conf` file must be included in your AxoSyslog configuration:
```
 
       @include "scl.conf"
    
```

The `slack()` driver is actually a reusable configuration snippet configured to send log messages using the `http()` driver. For details on using or writing such configuration snippets, see [Reusing configuration blocks](../../docs/axosyslog-core/chapter-configuration-file/large-configs/config-blocks/index.md). You can find the source of this configuration snippet on [GitHub](<https://github.com/axoflow/axosyslog/blob/master/scl/slack/slack.conf>).

## Prerequisites

To send messages and notifications from AxoSyslog to Slack, you must create a Slack app and a Webhook that AxoSyslog can use. For details, see the [Slack documentation](<https://api.slack.com/incoming-webhooks>).

## Example: Using the slack() driver

The following example sets the colors and the author of the message.
```
 
    @include "scl.conf"
    
    destination d_slack1 {
      slack(
        hook-url("https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX")
        colors("#000000,#222222,#444444,#666666,#888888,#AAAAAA,#CCCCCC,#EEEEEE")
        color-chooser(7)
        author-name("Example BOT")
        author-link("https://www.syslog-ng.com/products/open-source-log-management")
        author-icon("https://raw.githubusercontent.com/MrAnno/vscode-syslog-ng/master/images/syslog-ng-icon.png")
      );
    };
    
```

* * *

[Slack destination options](../../docs/axosyslog-core/chapter-destinations/destination-slack/reference-destination-slack/index.md)

Last modified January 14, 2026: [Fix type keyword in frontmatter (2c54f5f2)](<https://github.com/axoflow/axosyslog-core-docs/commit/2c54f5f2b98d4f14096313e9b73f5d169d659346>)