Need help with fluent-plugin-slack?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

sowawa
130 Stars 45 Forks 126 Commits 13 Opened issues

Services available

!
?

Need anything else?

Contributors list

# 15,675
Ruby
s3
sidekiq
Perl
40 commits
# 472,643
Shell
Ruby
20 commits
# 89,838
nagios
golang
adminis...
plugin-...
8 commits
# 19,698
Ruby
fluentd
cloudwa...
s3
5 commits
# 448,071
Shell
PHP
C
mruby
5 commits
# 99,301
circlec...
travis-...
pcre
Perl
4 commits
# 312,486
TeX
HTML
jupyter...
literat...
3 commits
# 64,867
Ruby
Rails
Markdow...
search-...
3 commits
# 656,589
Shell
Ruby
2 commits
# 334,262
TypeScr...
wiki
HTML
ansi-co...
2 commits
# 330,031
Shell
CSS
HTML
2 commits
# 19,052
fluentd
cloudwa...
Ruby
elastic
2 commits
# 95,000
command...
http-ap...
Flask
python-...
1 commit
# 597,483
Shell
sbt-plu...
HTML
CSS
1 commit
# 579,419
fluentd
cloudwa...
Common ...
HTML
1 commit

fluent-plugin-slack Build Status

Installation

$ fluent-gem install fluent-plugin-slack

Usage (Incoming Webhook)

  @type slack
  webhook_url https://hooks.slack.com/services/XXX/XXX/XXX
  channel general
  username sowasowa
  icon_emoji :ghost:
  flush_interval 60s

fluent_logger.post('slack', {
  :message  => 'Hello
World!' })

Usage (Slackbot)

  @type slack
  slackbot_url https://xxxx.slack.com/services/hooks/slackbot?token=XXXXXXXXX
  channel general
  flush_interval 60s

fluent_logger.post('slack', {
  :message  => 'Hello
World!' })

Usage (Web API a.k.a. Bots)

  @type slack
  token xoxb-XXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXX
  channel C061EG9SL
  username sowasowa
  icon_emoji :ghost:
  flush_interval 60s

fluent_logger.post('slack', {
  :message  => 'Hello
World!' })

Parameter

|parameter|description|default| |---|---|---| |webhookurl|Incoming Webhook URI (Required for Incoming Webhook mode). See https://api.slack.com/incoming-webhooks|| |slackboturl|Slackbot URI (Required for Slackbot mode). See https://api.slack.com/slackbot. NOTE: most of optional parameters such as

username
,
color
,
icon_emoji
,
icon_url
, and
title
are not available for this mode, but Desktop Notification via Highlight Words works with only this mode|| |token|Token for Web API (Required for Web API mode). See https://api.slack.com/web|| |asuser|post messages as a bot user. See https://api.slack.com/bot-users#postmessagesandreacttousers. NOTE: This parameter is only enabled if you use the Web API with your bot token. You cannot use both of
username
and
icon_emoji
(
icon_url
) when you set this parameter to
true
.|nil| |username|name of bot|nil| |color|color to use such as
good
or
bad
. See
Color
section of https://api.slack.com/docs/attachments. NOTE: This parameter must not be specified to receive Desktop Notification via Mentions in cases of Incoming Webhook and Slack Web API|nil| |iconemoji|emoji to use as the icon. either of `iconemoji
or
iconurl` can be specified|nil| |iconurl|url to an image to use as the icon. either of
icon_emoji
or
icon_url
can be specified|nil| |mrkdwn|enable formatting. see https://api.slack.com/docs/formatting|true| |linknames|find and link channel names and usernames. NOTE: This parameter must be
true
to receive Desktop Notification via Mentions in cases of Incoming Webhook and Slack Web API|true| |parse|change how messages are treated.
none
or
full
can be specified. See
Parsing mode
section of https://api.slack.com/docs/formatting|nil| |channel|Channel name or id to send messages (without first '#'). Channel ID is recommended because it is unchanged even if a channel is renamed|| |channel
keys|keys used to format channel. %s will be replaced with value specified by channelkeys if this option is used|nil| |title|title format. %s will be replaced with value specified by titlekeys. title is created from the first appeared record on each tag. NOTE: This parameter must not be specified to receive Desktop Notification via Mentions in cases of Incoming Webhook and Slack Web API|nil| |titlekeys|keys used to format the title|nil| |message|message format. %s will be replaced with value specified by messagekeys|%s| |messagekeys|keys used to format messages|message| |autochannelscreate|Create channels if not exist. Not available for Incoming Webhook mode (since Incoming Webhook is specific to a channel). A web api
token
for Normal User is required (Bot User can not create channels. See https://api.slack.com/bot-users)|false| |https
proxy|https proxy url such as
https://proxy.foo.bar:443
|nil| |verbose_fallback|Originally, only
title
is used for the fallback which is the message shown on popup if
title
is given. If this option is set to be
true
, messages are also included to the fallback attribute|false|

fluent-plugin-slack
uses
SetTimeKeyMixin
and
SetTagKeyMixin
, so you can also use:

|parameter|description|default| |---|---|---| |timezone|timezone such as

Asia/Tokyo
|| |localtime|use localtime as timezone|true| |utc|use utc as timezone|| |timekey|key name for time used in xxxkeys|time| |timeformat|time format. This will be formatted with Time#strftime.|%H:%M:%S| |tagkey|key name for tag used in xxx_keys|tag|

fluent-plugin-slack
is a kind of BufferedOutput plugin, so you can also use Buffer Parameters.

FAQ

Desktop Notification seems not working?

Currently, slack.com has following limitations:

  1. Desktop Notification via both Highlight Words and Mentions works only with Slackbot Remote Control
  2. Desktop Notification via Mentions works for the
    text
    field if
    link_names
    parameter is specified in cases of Incoming Webhook and Slack Web API, that is,
    • Desktop Notification does not work for the
      attachments
      filed (used in
      color
      and
      title
      )
    • Desktop Notification via Highlight Words does not work for Incoming Webhook and Slack Web API anyway

ChangeLog

See CHANGELOG.md for details.

Contributors

Copyright

  • Copyright:: Copyright (c) 2014- Keisuke SOGAWA
  • License:: Apache License, Version 2.0

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.