fluent-plugin-slack's People
Forkers
hokkai7go maripiyoko springmt sue445 kozmagabor rudolph-miller kenjiskywalker ladicle sonots jwyjoy lvicentesanchez alphastaxllc okkez mr-justin fujiwara morika-t cosmo0920 yizumi radicalpi eisuke calvinx408 yacchin1205 bz-keitaro-kobayashi noda-sin endlesspancake hirakiuc yoichi yoheimuta jngbng literalice chaosoldier miyaz tommarute xiaomage008 stakater olicuzo dimitrovvlado hosokawat transferwise sugy maxivak mostafahussein oscbacon kuroponzu bitjourney fluix koki1023 sigterm-incfluent-plugin-slack's Issues
multi worker start failed
when i use:
<system>
workers 4
</system>
[error]: config error file="/fluentd/etc/fluent.conf" error_class=Fluent::ConfigError error="Plugin 'buffered_slack' does not support multi workers configuration (Fluent::SlackOutput)"
multiple fluentd events are getting aggregated to single event; how to split it individual events ?
`encode' / "\xE3" from ASCII-8BIT to UTF-8
In our production environment, to_json errors have occurred after updating td-agent v2.3.5.
2017-05-16 17:20:23 +0900 [error]: plugin/out_slack.rb:231:rescue in write: out_slack: error="\"\\xE3\" from ASCII-8BIT to UTF-8" error_class="Encoding::UndefinedConversionError"
This error is when fluent-plugin-slack to_json the output of fluent-plugin-rds-slowlog (v0.7.0).
Specifically, in-rds-slowlog outputs ASCII-8BIT encoded character string, but out_slack's to_json expects UTF-8 encoded character string, so it is an error.
Since the same thing can happen besides in-rds-slowlog, I want to use Yajl instead of JSON, because to_json method raise error when receive multibyte text.
How about that? If so, I will make a PR.
can not find slack plugin
I have installed the slack plugin. When checked with "gem list", it shows "fluent-plugin-slack (0.6.7)". And when i started fluentd, it shows "config error file="/etc/td-agent/td-agent.conf" error_class=Fluent::ConfigError error="Unknown output plugin 'slack'. Run 'gem search -rd fluent-plugin' to find plugins". It seems the plugin does not install, why?
multiple fluentd events are getting aggregated to single event
How to split it to individual events ?
I m using labels to route from fluentd source to slack output,
Using buffered parameters :
chunk_limit_size 1k
chunk_limit_records 1
flush_interval 1s
How to convert them to single message with one event ?
Also the message is not getting truncated.
Any help ?
Question: Use mulitple fields
Thank you for the awesome slack plugin. I am trying to post a slack attachment message with multiple fields but i unable to achieve it. I am only able to create single field per msg using the following configuration
<match kube.**>
@type slack
webhook_url "#{ENV['SLACK_WEBHOOK_URL']}"
channel "#{ENV['SLACK_CHANNEL']}"
username fluentd
message %s
message_keys log
title Pod: %s
title_keys kube_tag
icon_emoji :ghost:
flush_interval 1s
mrkdwn true
color danger
</match>
I would like to add other fields as well but not able to figure out how can we achieve it.
Can't send
I try to send logs to my slack team using this but it won't send any logs.
2015-05-14 21:18:04 +0900 [info]: out_slack: post_message {:channel=>"#logs", :text=>"oijwef\n", :mrkdwn=>true, :link_names=>true}
2015-05-14 21:18:04 +0900 [warn]: temporarily failed to flush the buffer. next_retry=2015-05-14 21:20:03 +0900 error_class="NameError" error="uninitialized constant Net::OpenTimeout" instance=70183716234940
2015-05-14 21:18:04 +0900 [warn]: /usr/lib64/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluent-plugin-slack-0.6.0/lib/fluent/plugin/out_slack.rb:131:in `rescue in write'
2015-05-14 21:18:04 +0900 [warn]: /usr/lib64/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluent-plugin-slack-0.6.0/lib/fluent/plugin/out_slack.rb:128:in `write'
2015-05-14 21:18:04 +0900 [warn]: /usr/lib64/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.55/lib/fluent/buffer.rb:296:in `write_chunk'
2015-05-14 21:18:04 +0900 [warn]: /usr/lib64/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.55/lib/fluent/buffer.rb:276:in `pop'
2015-05-14 21:18:04 +0900 [warn]: /usr/lib64/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.55/lib/fluent/output.rb:311:in `try_flush'
2015-05-14 21:18:04 +0900 [warn]: /usr/lib64/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.55/lib/fluent/output.rb:132:in `run'
2015-05-14 21:18:06 +0900 applicationlog.testtest: {"message":"oijwef"}
my config
<match applicationlog.testtest>
type copy
<store>
type stdout
</store>
<store>
type slack
webhook_url http://hooks.slack.com/services/xxxxxx/xxxxx/xxxxxxxxx
channel logs
flush_interval 1s
</store>
</match>
Can not find slack plugin
After using "fluent-gem install fluent-plugin-slack" to install slack plugin, when start td-agent.service, failed due to config error file="/etc/td-agent/td-agent.conf" error_class=Fluent::ConfigError error="Unknown output plugin 'slack'. Run 'gem search -rd fluent-plugin' to find plugins". It's seems strange.
Example setting to README
๐
Escaping < and > breaks formatted links
In c5b7158 code was added to escape <
, >
, and &
per Slack's formatting Docs. However, by escaping these values across the board, formatted links like the following no longer work: <https://google.com|My Link>
`out_buffered_slack.rb` symlink is broken.
cache/flu/fluent-plugin-slack-0.6.7/lib/fluent/plugin/out_buffered_slack.rb -> lib/fluent/plugin/out_slack.rb
It needs to be relative to the current path.
Ability to use more than one slack plugin with custom icons/username options
Hi there,
I have the following use case:
- in my fluentd config I'm splitting logs into error and performance channels (tags)
- so I want to apply different slack icons/usernames per each slack plugin (Now it's impossible because slack plugin caches the common config and icon_emoji/username options are part of it)
How come no examples for sending to Slack?
The examples seem to show how to receive messages from Slack, rather than sending to Slack. I'm not sure why anyone would want the former. I tried to get it working but failed. I've documented the issue here: https://serverfault.com/questions/1160392/how-can-i-resolve-fluentd-plugin-slack-error-when-starting-fluentd-daemon-undef
It would be awesome if someone could help me get this working, or post some examples of sending to Slack to the README. I tried getting help on the Slack server for Fluent but no-one bit.
[feature request] support for color_key
Support to read color from record specified by color_key
then we can color messages for example for different log levels, ...
Line breaks in posted value are ignored
Running into an issue with the posted value data not actually honouring line breaks.
From the log:
out_slack: post_message {:attachments=>[{:fallback=>"Log:logs.one.one-api.err.err.log Host:one-prod-ip-10-0-7-52", :fields=>[{:title=>"Log:logs.foo.foo-api.err.err.log Host:foo-prod-ip-10-0-7-52", :value=>"Error: Invalid LocationID \nStatus Code: 404\nType: notFoundError\n"}], :color=>"danger", :mrkdwn_in=>["text", "fields"]}], :channel=>"#jenkins", :username=>"fluentd", :icon_emoji=>":ghost:", :mrkdwn=>true, :link_names=>true}
I am new to fluentd, is there a trick to adding line breaks?
This is what was posted into slack:
Log:logs.foo.foo-api.err.err.log Host:foo-prod-ip-10-0-7-52
Error: Invalid LocationID \nStatus Code: 404\nType: notFoundError
I did try <br> as well, and that just posted <br> into the slack channel.
I am using the webhooks implementation for this.
Any suggestions?
Channel should not be mandatory when using a webhook
An incoming-webhook has to be created for a given channel; forcing users to provide a channel through configuration in that case, makes the plugin unusable if you want to send logs to a private channel.
Travis
@sowawa Could you turn on travis and put a badge to it on README.md?
The specified key 'message' not found
I'm trying to use your slack plugin, but the logs generated by my docker engine seem to be formatted as a json with a log
entry instead of a message
one.
I'm using docker 1.9.1 (API version 1.21), fluentd 0.12.22 and fluent-plugin-slack (0.6.2). My fluentd configuration is:
<match slack.*>
type slack
webhook_url https://hooks.slack.com/services/x/y/z
channel monitoring
username microservices
icon_emoji :ghost:
flush_interval 60s
</match>
And after trying a docker run -d --log-driver=fluentd --log-opt fluentd-tag="slack.test" alpine echo "hello"
, I obtain the next warning from fluentd:
2016-05-03 14:30:17 +0000 [warn]: out_slack: the specified key 'message' not found in record. [{"container_id"=>"7e4dde134cc57379c0a924b8c5ad3f5b463d5d490ca2061561a6261e98da4c34", "container_name"=>"/goofy_babbage", "source"=>"stdout", "log"=>"hello", "time"=>"14:29:35", "tag"=>"slack.test"}]
2016-05-03 14:30:17 +0000 [info]: out_slack: post_message {:channel=>"#devops", :text=>"\n", :username=>"ecs", :icon_emoji=>":ghost:", :mrkdwn=>true, :link_names=>true}
Any idea?
Usage of /dev/null
/dev/null
is explicitly used here: https://github.com/sowawa/fluent-plugin-slack/blob/master/lib/fluent/plugin/slack_client.rb#L32
That makes it impossible to use this plugin on windows. Do you think it could be changed?
Truncating of messages
I have recently come to this issue, which is still a problem. My messages are truncated even after not that many characters roughly 2k. Any idea how to solve that?
Toward v2
This issue describes a loadmap to v2.
Once release v1 (nothing is changed with v0.xx) to do semantic versioning, then work for v2.
Breaking changes:
- To fix #28, revert escaping special characters in message.
- By historical reasons, default values of some parameters are different with Slack API default values. Align with Slack API default values.
- Allow adding arbitrary slack parameters
- Migrate to Fluentd v0.14 (v1) API.
Allow adding arbitrary slack parameters
Slack API itself evolves, and will support new parameters. I want to support new parameters without updating slack plugin.
Maybe we can achieve by changing interfaces as:
<match slack>
@type slack
webhook_url https://hooks.slack.com/services/XXX/XXX/XXX
<payload>
channel general
username sonots
# arbitrary key=val parameters can be added
</payload>
</match>
If we support only Fluentd >= v0.14.20, users can get dynamic values from nested records via record accessor as:
ref. https://www.fluentd.org/blog/fluentd-v0.14.20-has-been-released
<match slack>
@type slack
webhook_url https://hooks.slack.com/services/XXX/XXX/XXX
<payload>
channel $.foo.channel
username $["username"]
# arbitrary key=val parameters can be added
</payload>
</match>
TODO: Test whether we can write ruby codes combined with record accessor as #{$.text..gsub(/&/, '&').gsub(/</, '<').gsub(/>/, '>')}
(hmm, looks not possible) so that users can write their own escaping function by themselves to support #22.
TODO: Think how to support nested parameters. Create config_section dynamically?
payload
channel
username
attachments
blah blah
[feature request] Nested attributes
Hi there. โ๏ธ
Parameter messege_keys
seems not to be accepted nested value, right?
I want to send the nested value such as fabric8io/fluent-plugin-kubernetes_metadata_filter plugin attaching nested output (like $.kubernetes.pod_name
).
fluent-plugin-rewrite-tag-filter supports this
https://github.com/fluent/fluent-plugin-rewrite-tag-filter#nested-attributes
btw record_accessor seems to require v0.14.20...
What do you think of this?
Support to post from proxy
๐ด
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.