logstash-output-sns 0.1.2 → 0.1.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: 1c2125ff13f3389e723473f23d9bd1a5c2332721
4
- data.tar.gz: d405ae1d5e66599ab2253be9b852db62ba259864
3
+ metadata.gz: 326996117d41a11f9b79bb8d7d519623e3e81a60
4
+ data.tar.gz: 9798a5a8a0684396138ad133b385560bf7f2a3d7
5
5
  SHA512:
6
- metadata.gz: f9bd9ec1c05d0b79fad66d28c494e731a43eedc6fdd5864aab289a405f1a9e486949bcdcf82b0dcbca4b4fcc15950c407b57a0458ac7feaa56316cc3c549a882
7
- data.tar.gz: a2334bce692e31305458dfc21638d2725ef482da8c50f8f86636d4ea8065c58769b1881e137349f5dc52a2a0cf58f6c4fd0c4f6c10d27a1a2a2a076725c7057a
6
+ metadata.gz: 96c70ccdd86a647ec7bda0afa669955997e9a9ba939c43d971a84c2540f5181e51572d0087cbb7c307dd6113efa943b38dcb808a56ecc7880c8a0797506b22b4
7
+ data.tar.gz: 34d85f6913f33bb61c4aa0b52b8967e44cf5f2cc5976422ae6117e3199a400606cc6114cc83b09300274b425dbb52408271b095042502fe039e5144f0f7e08e3
data/Gemfile CHANGED
@@ -1,3 +1,2 @@
1
1
  source 'https://rubygems.org'
2
- gemspec
3
- gem "logstash", :github => "elasticsearch/logstash", :branch => "1.5"
2
+ gemspec
data/README.md CHANGED
@@ -22,7 +22,7 @@ Need help? Try #logstash on freenode IRC or the logstash-users@googlegroups.com
22
22
  #### Code
23
23
  - To get started, you'll need JRuby with the Bundler gem installed.
24
24
 
25
- - Create a new plugin or clone and existing from the GitHub [logstash-plugins](https://github.com/logstash-plugins) organization.
25
+ - Create a new plugin or clone and existing from the GitHub [logstash-plugins](https://github.com/logstash-plugins) organization. We also provide [example plugins](https://github.com/logstash-plugins?query=example).
26
26
 
27
27
  - Install dependencies
28
28
  ```sh
@@ -31,26 +31,15 @@ bundle install
31
31
 
32
32
  #### Test
33
33
 
34
- ```sh
35
- bundle exec rspec
36
- ```
34
+ - Update your dependencies
37
35
 
38
- The Logstash code required to run the tests/specs is specified in the `Gemfile` by the line similar to:
39
- ```ruby
40
- gem "logstash", :github => "elasticsearch/logstash", :branch => "1.5"
41
- ```
42
- To test against another version or a local Logstash, edit the `Gemfile` to specify an alternative location, for example:
43
- ```ruby
44
- gem "logstash", :github => "elasticsearch/logstash", :ref => "master"
45
- ```
46
- ```ruby
47
- gem "logstash", :path => "/your/local/logstash"
36
+ ```sh
37
+ bundle install
48
38
  ```
49
39
 
50
- Then update your dependencies and run your tests:
40
+ - Run tests
51
41
 
52
42
  ```sh
53
- bundle install
54
43
  bundle exec rspec
55
44
  ```
56
45
 
@@ -58,13 +47,13 @@ bundle exec rspec
58
47
 
59
48
  #### 2.1 Run in a local Logstash clone
60
49
 
61
- - Edit Logstash `tools/Gemfile` and add the local plugin path, for example:
50
+ - Edit Logstash `Gemfile` and add the local plugin path, for example:
62
51
  ```ruby
63
52
  gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
64
53
  ```
65
- - Update Logstash dependencies
54
+ - Install plugin
66
55
  ```sh
67
- rake vendor:gems
56
+ bin/plugin install --no-verify
68
57
  ```
69
58
  - Run Logstash with your plugin
70
59
  ```sh
@@ -74,6 +63,8 @@ At this point any modifications to the plugin code will be applied to this local
74
63
 
75
64
  #### 2.2 Run in an installed Logstash
76
65
 
66
+ You can use the same **2.1** method to run your plugin in an installed Logstash by editing its `Gemfile` and pointing the `:path` to your local plugin development directory or you can build the gem and install it using:
67
+
77
68
  - Build your plugin gem
78
69
  ```sh
79
70
  gem build logstash-filter-awesome.gemspec
@@ -90,6 +81,6 @@ All contributions are welcome: ideas, patches, documentation, bug reports, compl
90
81
 
91
82
  Programming is not a required skill. Whatever you've seen about open source and maintainers or community members saying "send patches or die" - you will not see that here.
92
83
 
93
- It is more important to me that you are able to contribute.
84
+ It is more important to the community that you are able to contribute.
94
85
 
95
- For more information about contributing, see the [CONTRIBUTING](https://github.com/elasticsearch/logstash/blob/master/CONTRIBUTING.md) file.
86
+ For more information about contributing, see the [CONTRIBUTING](https://github.com/elasticsearch/logstash/blob/master/CONTRIBUTING.md) file.
@@ -113,7 +113,7 @@ class LogStash::Outputs::Sns < LogStash::Outputs::Base
113
113
  def self.format_message(event)
114
114
  message = "Date: #{event.timestamp}\n"
115
115
  message << "Source: #{event["source"]}\n"
116
- message << "Tags: #{event["tags"].join(', ')}\n"
116
+ message << "Tags: #{(event["tags"] || []).join(', ')}\n"
117
117
  message << "Fields: #{event.to_hash.inspect}\n"
118
118
  message << "Message: #{event["message"]}"
119
119
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-output-sns'
4
- s.version = '0.1.2'
4
+ s.version = '0.1.3'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Send events to Amazon's Simple Notification Service a hosted pub/sub framework"
7
7
  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"
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.metadata = { "logstash_plugin" => "true", "logstash_group" => "output" }
21
21
 
22
22
  # Gem dependencies
23
- s.add_runtime_dependency 'logstash', '>= 1.4.0', '< 2.0.0'
23
+ s.add_runtime_dependency "logstash-core", '>= 1.4.0', '< 2.0.0'
24
24
  s.add_runtime_dependency 'logstash-mixin-aws'
25
25
  s.add_runtime_dependency 'aws-sdk'
26
26
 
@@ -1,6 +1,18 @@
1
1
  # encoding: utf-8
2
2
  require "logstash/devutils/rspec/spec_helper"
3
3
  require 'logstash/outputs/sns'
4
+ require 'logstash/event'
4
5
 
5
6
  describe LogStash::Outputs::Sns do
7
+ describe '#format_message' do
8
+ it 'should allow to output to sns with empty tags' do
9
+ event = LogStash::Event.new({ "message" => "42 is the answer" })
10
+ expect(LogStash::Outputs::Sns.format_message(event)).to match(/Tags:\s\n/m)
11
+ end
12
+
13
+ it 'should allow to output to sns with a list of tags' do
14
+ event = LogStash::Event.new({"tags" => ["elasticsearch", "logstash", "kibana"] })
15
+ expect(LogStash::Outputs::Sns.format_message(event)).to match(/\nTags:\selasticsearch,\slogstash,\skibana\n/m)
16
+ end
17
+ end
6
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-sns
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elasticsearch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-28 00:00:00.000000000 Z
11
+ date: 2015-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -19,7 +19,7 @@ dependencies:
19
19
  - - <
20
20
  - !ruby/object:Gem::Version
21
21
  version: 2.0.0
22
- name: logstash
22
+ name: logstash-core
23
23
  prerelease: false
24
24
  type: :runtime
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  requirements: []
111
111
  rubyforge_project:
112
- rubygems_version: 2.1.9
112
+ rubygems_version: 2.4.5
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: Send events to Amazon's Simple Notification Service a hosted pub/sub framework