logstash-output-pagerduty 1.0.0 → 2.0.0

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: 86f44dc7d8d1da1287e25ca85aeffdbc96589be4
4
- data.tar.gz: 869df332168862defb820cd67d1dbde9f474cbc2
3
+ metadata.gz: 20efa99d3f896d3c712160d2cfb81c6e8994b00f
4
+ data.tar.gz: ad35c8971001cf18f830207a9a5b637de47dd803
5
5
  SHA512:
6
- metadata.gz: 4731badd783a156f65eed50317796aaa77797460a850d826d0c63fabc0c772139a9877b3cb1aa766932f9e7980088190192acd781be9e73a17f2f2f32ad71255
7
- data.tar.gz: 01f96c18cdb4727ddc6b320dd54de80e66bc89ecd4540b5d20a29d01bca27061b03e85dea4d48ef524960683f1eb0334ca33a62b5cdc6e4e45d758dc7e2b6d02
6
+ metadata.gz: 10d1a914fe84b852fb86337bc647fbb9bd7961f271e3cc6d2486b9837787ebd117ef1107dd72848f79bea661aecec9237a7f49a72c8663dd04f5010521a2d317
7
+ data.tar.gz: 58740687385a97fdc9e7947fbefa1d7bcc7521825923093da623dc815a858717fa05d54d66ab7c5ed9fdba5de26cc8269feed83319906d8c6e42ac4b6b5f86e1
data/CHANGELOG.md CHANGED
@@ -0,0 +1,2 @@
1
+ # 1.0.1
2
+ - Add basic test to the project
data/README.md CHANGED
@@ -1,15 +1,15 @@
1
1
  # Logstash Plugin
2
2
 
3
- This is a plugin for [Logstash](https://github.com/elasticsearch/logstash).
3
+ This is a plugin for [Logstash](https://github.com/elastic/logstash).
4
4
 
5
5
  It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
6
6
 
7
7
  ## Documentation
8
8
 
9
- Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elasticsearch.org/guide/en/logstash/current/).
9
+ Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elastic.co/guide/en/logstash/current/).
10
10
 
11
11
  - For formatting code or config example, you can use the asciidoc `[source,ruby]` directive
12
- - For more asciidoc formatting tips, see the excellent reference here https://github.com/elasticsearch/docs#asciidoc-guide
12
+ - For more asciidoc formatting tips, see the excellent reference here https://github.com/elastic/docs#asciidoc-guide
13
13
 
14
14
  ## Need Help?
15
15
 
@@ -83,4 +83,4 @@ Programming is not a required skill. Whatever you've seen about open source and
83
83
 
84
84
  It is more important to the community that you are able to contribute.
85
85
 
86
- 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/elastic/logstash/blob/master/CONTRIBUTING.md) file.
@@ -69,9 +69,8 @@ class LogStash::Outputs::PagerDuty < LogStash::Outputs::Base
69
69
  @logger.debug("PD Request", :request => request.inspect)
70
70
  response = @client.request(request)
71
71
  @logger.debug("PD Response", :response => response.body)
72
-
73
72
  rescue Exception => e
74
- @logger.debug("PD Unhandled exception", :pd_error => e.backtrace)
73
+ @logger.error("PD Unhandled exception", :pd_error => e.backtrace)
75
74
  end
76
75
  end # def receive
77
76
  end # class LogStash::Outputs::PagerDuty
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-output-pagerduty'
4
- s.version = '1.0.0'
4
+ s.version = '2.0.0'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "The PagerDuty output will send notifications based on pre-configured services and escalation policies."
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"
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.require_paths = ["lib"]
12
12
 
13
13
  # Files
14
- s.files = `git ls-files`.split($\)+::Dir.glob('vendor/*')
14
+ s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
15
15
 
16
16
  # Tests
17
17
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
@@ -20,8 +20,10 @@ 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-core", '>= 1.4.0', '< 2.0.0'
23
+ s.add_runtime_dependency "logstash-core", "~> 2.0.0.snapshot"
24
+ s.add_runtime_dependency 'logstash-codec-plain'
24
25
 
25
26
  s.add_development_dependency 'logstash-devutils'
27
+ s.add_development_dependency 'webmock', '~> 1.21.0'
26
28
  end
27
29
 
@@ -1 +1,30 @@
1
- require "logstash/devutils/rspec/spec_helper"
1
+ require_relative "../spec_helper"
2
+
3
+ describe LogStash::Outputs::PagerDuty do
4
+
5
+ it "should register without errors" do
6
+ plugin = LogStash::Plugin.lookup("output", "pagerduty").new("service_key" => "")
7
+ expect { plugin.register }.to_not raise_error
8
+ end
9
+
10
+ describe "#send" do
11
+ subject { LogStash::Outputs::PagerDuty.new( "service_key" => "my_service_key" ) }
12
+ let(:properties) { { "message" => "This is a message!" } }
13
+ let(:event) { LogStash::Event.new(properties) }
14
+ let(:logger) { subject.logger }
15
+
16
+ before(:each) do
17
+ subject.register
18
+ end
19
+
20
+ it "send the event to pagerduty" do
21
+ stub_request(:post, /#{subject.pdurl}/).
22
+ to_return(status: 200, body: "stubbed response", headers: {})
23
+ expect(logger).to receive(:debug).with("PD Response", :response => "stubbed response").once
24
+ expect(logger).to receive(:debug).with("PD Request", kind_of(Hash)).once
25
+ expect(logger).to receive(:debug).with("PD Details added:", kind_of(Hash)).twice
26
+ subject.receive(event)
27
+ end
28
+
29
+ end
30
+ end
@@ -0,0 +1,4 @@
1
+ require "logstash/devutils/rspec/spec_helper"
2
+ require "logstash/outputs/pagerduty"
3
+
4
+ require "webmock/rspec"
metadata CHANGED
@@ -1,66 +1,87 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-pagerduty
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-24 00:00:00.000000000 Z
11
+ date: 2015-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ~>
17
+ - !ruby/object:Gem::Version
18
+ version: 2.0.0.snapshot
14
19
  name: logstash-core
20
+ prerelease: false
21
+ type: :runtime
15
22
  version_requirements: !ruby/object:Gem::Requirement
16
23
  requirements:
17
- - - '>='
18
- - !ruby/object:Gem::Version
19
- version: 1.4.0
20
- - - <
24
+ - - ~>
21
25
  - !ruby/object:Gem::Version
22
- version: 2.0.0
26
+ version: 2.0.0.snapshot
27
+ - !ruby/object:Gem::Dependency
23
28
  requirement: !ruby/object:Gem::Requirement
24
29
  requirements:
25
30
  - - '>='
26
31
  - !ruby/object:Gem::Version
27
- version: 1.4.0
28
- - - <
29
- - !ruby/object:Gem::Version
30
- version: 2.0.0
32
+ version: '0'
33
+ name: logstash-codec-plain
31
34
  prerelease: false
32
35
  type: :runtime
33
- - !ruby/object:Gem::Dependency
34
- name: logstash-devutils
35
36
  version_requirements: !ruby/object:Gem::Requirement
36
37
  requirements:
37
38
  - - '>='
38
39
  - !ruby/object:Gem::Version
39
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
40
42
  requirement: !ruby/object:Gem::Requirement
41
43
  requirements:
42
44
  - - '>='
43
45
  - !ruby/object:Gem::Version
44
46
  version: '0'
47
+ name: logstash-devutils
48
+ prerelease: false
49
+ type: :development
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ~>
59
+ - !ruby/object:Gem::Version
60
+ version: 1.21.0
61
+ name: webmock
45
62
  prerelease: false
46
63
  type: :development
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 1.21.0
47
69
  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
48
70
  email: info@elastic.co
49
71
  executables: []
50
72
  extensions: []
51
73
  extra_rdoc_files: []
52
74
  files:
53
- - .gitignore
54
75
  - CHANGELOG.md
55
76
  - CONTRIBUTORS
56
77
  - Gemfile
57
78
  - LICENSE
58
79
  - NOTICE.TXT
59
80
  - README.md
60
- - Rakefile
61
81
  - lib/logstash/outputs/pagerduty.rb
62
82
  - logstash-output-pagerduty.gemspec
63
83
  - spec/outputs/pagerduty_spec.rb
84
+ - spec/spec_helper.rb
64
85
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
65
86
  licenses:
66
87
  - Apache License (2.0)
@@ -83,9 +104,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
104
  version: '0'
84
105
  requirements: []
85
106
  rubyforge_project:
86
- rubygems_version: 2.2.2
107
+ rubygems_version: 2.4.8
87
108
  signing_key:
88
109
  specification_version: 4
89
110
  summary: The PagerDuty output will send notifications based on pre-configured services and escalation policies.
90
111
  test_files:
91
112
  - spec/outputs/pagerduty_spec.rb
113
+ - spec/spec_helper.rb
data/.gitignore DELETED
@@ -1,4 +0,0 @@
1
- *.gem
2
- Gemfile.lock
3
- .bundle
4
- vendor
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"