logstash-output-slack 2.0.1 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61ace7e76d99a221db11bd47a812cc746e1032ce
4
- data.tar.gz: 944057665b4ec00ae09bd9b38e24862bb1e9e384
3
+ metadata.gz: 0897c3faaa18a89fce7646142a13c0188280a934
4
+ data.tar.gz: d301820d07c3157c2da4420f36df84395c903e8b
5
5
  SHA512:
6
- metadata.gz: fefb95e4e3373a97b07061acbe617c64fdd50aee419d47ea90ff0f19bb4ef4f50966241da005ad382b01fbb4d25acb94f4ea765b1738e984c16cd21b38315ea1
7
- data.tar.gz: 00132dac25daff34776cee7b8ffdee2f59dd65c15d00393fa1ead19bac97b160045bde53598190b829902ffa7f8ec069409e0cbc80cd01b3e25d0c9ac11b0c5a
6
+ metadata.gz: 86c8fe1525a38d591e5d2131f0e70b98a51cc9376d23534f8a86f7d1947ed1bab528c524bb7dd8d88914b46c54d907c67e99f446a20b814604e3095dda681b79
7
+ data.tar.gz: 6437a6cc6a846de24ffd713429c3ffcd6d4e8b076428165e077257e1a567ea5e7976928601d739f550035d877f41629c55bc97fb10446c9ce9c7b3db29fa0247
@@ -1,3 +1,6 @@
1
+ ## 2.0.2
2
+ - Enable event based data in attachments
3
+
1
4
  ## 2.0.1
2
5
  - Update codec dependencies
3
6
 
data/Gemfile CHANGED
@@ -1,2 +1,11 @@
1
1
  source 'https://rubygems.org'
2
+
2
3
  gemspec
4
+
5
+ logstash_path = ENV["LOGSTASH_PATH"] || "../../logstash"
6
+ use_logstash_source = ENV["LOGSTASH_SOURCE"] && ENV["LOGSTASH_SOURCE"].to_s == "1"
7
+
8
+ if Dir.exist?(logstash_path) && use_logstash_source
9
+ gem 'logstash-core', :path => "#{logstash_path}/logstash-core"
10
+ gem 'logstash-core-plugin-api', :path => "#{logstash_path}/logstash-core-plugin-api"
11
+ end
@@ -0,0 +1,107 @@
1
+ :plugin: slack
2
+ :type: output
3
+
4
+ ///////////////////////////////////////////
5
+ START - GENERATED VARIABLES, DO NOT EDIT!
6
+ ///////////////////////////////////////////
7
+ :version: %VERSION%
8
+ :release_date: %RELEASE_DATE%
9
+ :changelog_url: %CHANGELOG_URL%
10
+ :include_path: ../../../../logstash/docs/include
11
+ ///////////////////////////////////////////
12
+ END - GENERATED VARIABLES, DO NOT EDIT!
13
+ ///////////////////////////////////////////
14
+
15
+ [id="plugins-{type}-{plugin}"]
16
+
17
+ === Slack output plugin
18
+
19
+ include::{include_path}/plugin_header.asciidoc[]
20
+
21
+ ==== Description
22
+
23
+
24
+
25
+ [id="plugins-{type}s-{plugin}-options"]
26
+ ==== Slack Output Configuration Options
27
+
28
+ This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
29
+
30
+ [cols="<,<,<",options="header",]
31
+ |=======================================================================
32
+ |Setting |Input type|Required
33
+ | <<plugins-{type}s-{plugin}-attachments>> |<<array,array>>|No
34
+ | <<plugins-{type}s-{plugin}-channel>> |<<string,string>>|No
35
+ | <<plugins-{type}s-{plugin}-format>> |<<string,string>>|No
36
+ | <<plugins-{type}s-{plugin}-icon_emoji>> |<<string,string>>|No
37
+ | <<plugins-{type}s-{plugin}-icon_url>> |<<string,string>>|No
38
+ | <<plugins-{type}s-{plugin}-url>> |<<string,string>>|Yes
39
+ | <<plugins-{type}s-{plugin}-username>> |<<string,string>>|No
40
+ |=======================================================================
41
+
42
+ Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
43
+ output plugins.
44
+
45
+ &nbsp;
46
+
47
+ [id="plugins-{type}s-{plugin}-attachments"]
48
+ ===== `attachments`
49
+
50
+ * Value type is <<array,array>>
51
+ * There is no default value for this setting.
52
+
53
+ Attachments array as described https://api.slack.com/docs/attachments
54
+
55
+ [id="plugins-{type}s-{plugin}-channel"]
56
+ ===== `channel`
57
+
58
+ * Value type is <<string,string>>
59
+ * There is no default value for this setting.
60
+
61
+ The channel to post to
62
+
63
+ [id="plugins-{type}s-{plugin}-format"]
64
+ ===== `format`
65
+
66
+ * Value type is <<string,string>>
67
+ * Default value is `"%{message}"`
68
+
69
+ The text to post in slack
70
+
71
+ [id="plugins-{type}s-{plugin}-icon_emoji"]
72
+ ===== `icon_emoji`
73
+
74
+ * Value type is <<string,string>>
75
+ * There is no default value for this setting.
76
+
77
+ Emoji icon to use
78
+
79
+ [id="plugins-{type}s-{plugin}-icon_url"]
80
+ ===== `icon_url`
81
+
82
+ * Value type is <<string,string>>
83
+ * There is no default value for this setting.
84
+
85
+ Icon URL to use
86
+
87
+ [id="plugins-{type}s-{plugin}-url"]
88
+ ===== `url`
89
+
90
+ * This is a required setting.
91
+ * Value type is <<string,string>>
92
+ * There is no default value for this setting.
93
+
94
+ The incoming webhook URI needed to post a message
95
+
96
+ [id="plugins-{type}s-{plugin}-username"]
97
+ ===== `username`
98
+
99
+ * Value type is <<string,string>>
100
+ * There is no default value for this setting.
101
+
102
+ The username to use for posting
103
+
104
+
105
+
106
+ [id="plugins-{type}s-{plugin}-common-options"]
107
+ include::{include_path}/{type}.asciidoc[]
@@ -60,9 +60,9 @@ class LogStash::Outputs::Slack < LogStash::Outputs::Base
60
60
  end
61
61
 
62
62
  if @attachments and @attachments.any?
63
- payload_json['attachments'] = @attachments
63
+ payload_json['attachments'] = @attachments.map { |x| JSON.parse(event.sprintf(JSON.dump(x))) }
64
64
  end
65
- if event.include?('attachments') and event['attachments'].is_a?(Array)
65
+ if event.include?('attachments') and event.get('attachments').is_a?(Array)
66
66
  if event.get('attachments').any?
67
67
  # need to convert possibly from Java objects to Ruby Array, because
68
68
  # JSON dumps does not work well with Java ArrayLists, etc.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-slack'
3
- s.version = '2.0.1'
3
+ s.version = '2.0.3'
4
4
  s.licenses = ['MIT','Apache License (2.0)']
5
5
  s.summary = "Write events to Slack"
6
6
  s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.require_paths = ["lib"]
11
11
 
12
12
  # Files
13
- s.files = `git ls-files`.split($\)
13
+ s.files = Dir["lib/**/*","spec/**/*","*.gemspec","*.md","CONTRIBUTORS","Gemfile","LICENSE","NOTICE.TXT", "vendor/jar-dependencies/**/*.jar", "vendor/jar-dependencies/**/*.rb", "VERSION", "docs/**/*"]
14
14
 
15
15
  # Tests
16
16
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-slack
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ying Li
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-06 00:00:00.000000000 Z
11
+ date: 2017-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -146,16 +146,11 @@ executables: []
146
146
  extensions: []
147
147
  extra_rdoc_files: []
148
148
  files:
149
- - ".github/CONTRIBUTING.md"
150
- - ".github/ISSUE_TEMPLATE.md"
151
- - ".github/PULL_REQUEST_TEMPLATE.md"
152
- - ".gitignore"
153
- - ".travis.yml"
154
149
  - CHANGELOG.md
155
150
  - Gemfile
156
151
  - NOTICE.TXT
157
152
  - README.md
158
- - Rakefile
153
+ - docs/index.asciidoc
159
154
  - lib/logstash/outputs/slack.rb
160
155
  - logstash-output-slack.gemspec
161
156
  - spec/outputs/slack_spec.rb
@@ -1,65 +0,0 @@
1
- # Contributing to Logstash
2
-
3
- All contributions are welcome: ideas, patches, documentation, bug reports,
4
- complaints, etc!
5
-
6
- Programming is not a required skill, and there are many ways to help out!
7
- It is more important to us that you are able to contribute.
8
-
9
- That said, some basic guidelines, which you are free to ignore :)
10
-
11
- ## Want to learn?
12
-
13
- Want to lurk about and see what others are doing with Logstash?
14
-
15
- * The irc channel (#logstash on irc.freenode.org) is a good place for this
16
- * The [forum](https://discuss.elastic.co/c/logstash) is also
17
- great for learning from others.
18
-
19
- ## Got Questions?
20
-
21
- Have a problem you want Logstash to solve for you?
22
-
23
- * You can ask a question in the [forum](https://discuss.elastic.co/c/logstash)
24
- * Alternately, you are welcome to join the IRC channel #logstash on
25
- irc.freenode.org and ask for help there!
26
-
27
- ## Have an Idea or Feature Request?
28
-
29
- * File a ticket on [GitHub](https://github.com/elastic/logstash/issues). Please remember that GitHub is used only for issues and feature requests. If you have a general question, the [forum](https://discuss.elastic.co/c/logstash) or IRC would be the best place to ask.
30
-
31
- ## Something Not Working? Found a Bug?
32
-
33
- If you think you found a bug, it probably is a bug.
34
-
35
- * If it is a general Logstash or a pipeline issue, file it in [Logstash GitHub](https://github.com/elasticsearch/logstash/issues)
36
- * If it is specific to a plugin, please file it in the respective repository under [logstash-plugins](https://github.com/logstash-plugins)
37
- * or ask the [forum](https://discuss.elastic.co/c/logstash).
38
-
39
- # Contributing Documentation and Code Changes
40
-
41
- If you have a bugfix or new feature that you would like to contribute to
42
- logstash, and you think it will take more than a few minutes to produce the fix
43
- (ie; write code), it is worth discussing the change with the Logstash users and developers first! You can reach us via [GitHub](https://github.com/elastic/logstash/issues), the [forum](https://discuss.elastic.co/c/logstash), or via IRC (#logstash on freenode irc)
44
- Please note that Pull Requests without tests will not be merged. If you would like to contribute but do not have experience with writing tests, please ping us on IRC/forum or create a PR and ask our help.
45
-
46
- ## Contributing to plugins
47
-
48
- Check our [documentation](https://www.elastic.co/guide/en/logstash/current/contributing-to-logstash.html) on how to contribute to plugins or write your own! It is super easy!
49
-
50
- ## Contribution Steps
51
-
52
- 1. Test your changes! [Run](https://github.com/elastic/logstash#testing) the test suite
53
- 2. Please make sure you have signed our [Contributor License
54
- Agreement](https://www.elastic.co/contributor-agreement/). We are not
55
- asking you to assign copyright to us, but to give us the right to distribute
56
- your code without restriction. We ask this of all contributors in order to
57
- assure our users of the origin and continuing existence of the code. You
58
- only need to sign the CLA once.
59
- 3. Send a pull request! Push your changes to your fork of the repository and
60
- [submit a pull
61
- request](https://help.github.com/articles/using-pull-requests). In the pull
62
- request, describe what your changes do and mention any bugs/issues related
63
- to the pull request.
64
-
65
-
@@ -1,9 +0,0 @@
1
- Please post all product and debugging questions on our [forum](https://discuss.elastic.co/c/logstash). Your questions will reach our wider community members there, and if we confirm that there is a bug, then we can open a new issue here.
2
-
3
- For all general issues, please provide the following details for fast resolution:
4
-
5
- - Version:
6
- - Operating System:
7
- - Config File (if you have sensitive info, please remove it):
8
- - Sample Data:
9
- - Steps to Reproduce:
@@ -1 +0,0 @@
1
- Thanks for contributing to Logstash! If you haven't already signed our CLA, here's a handy link: https://www.elastic.co/contributor-agreement/
data/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- *.gem
2
- Gemfile.lock
3
- .ruby-version
4
- .bundle
5
- vendor
6
- lib/com
7
- lib/logstash-output-slack_jars.rb
8
- lib/org
@@ -1,9 +0,0 @@
1
- sudo: false
2
- jdk:
3
- - oraclejdk8
4
- language: ruby
5
- cache: bundler
6
- rvm:
7
- - jruby-1.7.25
8
- script:
9
- - bundle exec rspec spec
data/Rakefile DELETED
@@ -1,7 +0,0 @@
1
- @files=[]
2
-
3
- task :default do
4
- system("rake -T")
5
- end
6
-
7
- require "logstash/devutils/rake"