logstash-input-heroku 2.0.4 → 3.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: 999a35432867e5729776d2a23aa4d0653c580a1a
4
- data.tar.gz: b475a4f519c3c8008b1a86433d6e7b28e6092715
3
+ metadata.gz: 38e77dc87cdea75ea5825bb84bdd5c57ab87d74f
4
+ data.tar.gz: a10f8b643ce9802856add35a77b8abf98d6f37e7
5
5
  SHA512:
6
- metadata.gz: d163616dedbc4ad102a665050bda3e256fac6e403216bd2d16b38aee626ebe8b91a17155a45170978f43401c8292fd5cbd99a51714fc58fa797a914e52c2a4ed
7
- data.tar.gz: bd3285365b05a398aadc9a1ac3c05ee049d0f415bf74747d421e52b3cd4b867bfe566de4634e6089d994fdf8b3022449dceee2183f4179e0170ace8086409335
6
+ metadata.gz: 546ecee0a2fa62505659dd79580f0907744f127404171872323f5748fae95b4a8289f0c5c5aaad6005c5219de27116a71a49a576181d726b9401c0e1eb54d1c8
7
+ data.tar.gz: 81cd79966fdf268fbcb93caecd0662cd1b28f7de6a94774f02e17ff6d22aa50c42ecc76af2658ac1eeff3cbf52f378b06f15053231106db98d17329fe65ae5b7
@@ -1,3 +1,6 @@
1
+ # 3.0.0
2
+ - Breaking: depend on logstash-core-plugin-api between 1.60 and 2.99
3
+
1
4
  # 2.0.4
2
5
  - Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
3
6
  # 2.0.3
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012–2015 Elasticsearch <http://www.elastic.co>
1
+ Copyright (c) 2012–2016 Elasticsearch <http://www.elastic.co>
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Logstash Plugin
2
2
 
3
- [![Build
4
- Status](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Inputs/job/logstash-plugin-input-heroku-unit/badge/icon)](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Inputs/job/logstash-plugin-input-heroku-unit/)
3
+ [![Travis Build Status](https://travis-ci.org/logstash-plugins/logstash-input-heroku.svg)](https://travis-ci.org/logstash-plugins/logstash-input-heroku)
5
4
 
6
5
  This is a plugin for [Logstash](https://github.com/elastic/logstash).
7
6
 
@@ -56,7 +55,12 @@ gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
56
55
  ```
57
56
  - Install plugin
58
57
  ```sh
58
+ # Logstash 2.3 and higher
59
+ bin/logstash-plugin install --no-verify
60
+
61
+ # Prior to Logstash 2.3
59
62
  bin/plugin install --no-verify
63
+
60
64
  ```
61
65
  - Run Logstash with your plugin
62
66
  ```sh
@@ -74,7 +78,12 @@ gem build logstash-filter-awesome.gemspec
74
78
  ```
75
79
  - Install the plugin from the Logstash home
76
80
  ```sh
77
- bin/plugin install /your/local/plugin/logstash-filter-awesome.gem
81
+ # Logstash 2.3 and higher
82
+ bin/logstash-plugin install --no-verify
83
+
84
+ # Prior to Logstash 2.3
85
+ bin/plugin install --no-verify
86
+
78
87
  ```
79
88
  - Start Logstash and proceed to test the plugin
80
89
 
@@ -27,7 +27,7 @@ class LogStash::Inputs::Heroku < LogStash::Inputs::Base
27
27
 
28
28
  public
29
29
  def register
30
- require "heroku"
30
+ require "heroku/client"
31
31
  require "logstash/util/buftok"
32
32
  end # def register
33
33
 
@@ -43,7 +43,7 @@ class LogStash::Inputs::Heroku < LogStash::Inputs::Base
43
43
  client.read_logs(@app, ["tail=1", "num=1"]) do |chunk|
44
44
  @codec.decode(chunk) do |event|
45
45
  decorate(event)
46
- event["app"] = @app
46
+ event.set("app", @app)
47
47
  queue << event
48
48
  end
49
49
  end
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-heroku'
4
- s.version = '2.0.4'
4
+ s.version = '3.0.0'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Stream events from a heroku app's logs."
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"
7
+ s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
8
8
  s.authors = ["Elastic"]
9
9
  s.email = 'info@elastic.co'
10
10
  s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.metadata = { "logstash_plugin" => "true", "logstash_group" => "input" }
21
21
 
22
22
  # Gem dependencies
23
- s.add_runtime_dependency "logstash-core-plugin-api", "~> 1.0"
23
+ s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
24
24
 
25
25
  s.add_runtime_dependency 'logstash-codec-plain'
26
26
  s.add_runtime_dependency 'heroku'
@@ -1 +1,31 @@
1
- require "logstash/devutils/rspec/spec_helper"
1
+ require_relative "../spec_helper"
2
+
3
+ describe LogStash::Inputs::Heroku do
4
+
5
+ before :each do
6
+ @client = Heroku::Client.new("test", "pw")
7
+ allow(Heroku::Client).to receive(:new).and_return(@client)
8
+ allow(Heroku::Auth).to receive(:user).and_return("test")
9
+ allow(Heroku::Auth).to receive(:password).and_return("pw")
10
+ @input = LogStash::Plugin.lookup("input","heroku").new("app" => "test")
11
+ end
12
+
13
+ it "should register" do
14
+ expect{ @input.register }.to_not raise_error
15
+ end
16
+
17
+ context "when operating" do
18
+
19
+ before :each do
20
+ @queue = []
21
+ end
22
+
23
+ it "should read logs" do
24
+ allow(@client).to receive(:read_logs).and_yield("LOG LOG LOG LOG")
25
+ allow(LogStash::Event).to receive(:validate_value).and_return(true)
26
+ @input.run(@queue)
27
+ expect(@queue.length).to eq 1
28
+ expect(@queue.first.to_hash["message"]).to eq "LOG LOG LOG LOG"
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,5 @@
1
+ # encoding: utf-8
2
+ require "logstash/devutils/rspec/spec_helper"
3
+ require "logstash/inputs/heroku"
4
+ require "heroku/helpers"
5
+ require "heroku/client"
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-heroku
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 3.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: 2016-03-24 00:00:00.000000000 Z
11
+ date: 2016-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - "~>"
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '1.60'
19
+ - - "<="
17
20
  - !ruby/object:Gem::Version
18
- version: '1.0'
21
+ version: '2.99'
19
22
  name: logstash-core-plugin-api
20
23
  prerelease: false
21
24
  type: :runtime
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '1.60'
30
+ - - "<="
25
31
  - !ruby/object:Gem::Version
26
- version: '1.0'
32
+ version: '2.99'
27
33
  - !ruby/object:Gem::Dependency
28
34
  requirement: !ruby/object:Gem::Requirement
29
35
  requirements:
@@ -66,7 +72,7 @@ dependencies:
66
72
  - - ">="
67
73
  - !ruby/object:Gem::Version
68
74
  version: '0'
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
75
+ description: This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program
70
76
  email: info@elastic.co
71
77
  executables: []
72
78
  extensions: []
@@ -81,6 +87,7 @@ files:
81
87
  - lib/logstash/inputs/heroku.rb
82
88
  - logstash-input-heroku.gemspec
83
89
  - spec/inputs/heroku_spec.rb
90
+ - spec/spec_helper.rb
84
91
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
85
92
  licenses:
86
93
  - Apache License (2.0)
@@ -109,3 +116,4 @@ specification_version: 4
109
116
  summary: Stream events from a heroku app's logs.
110
117
  test_files:
111
118
  - spec/inputs/heroku_spec.rb
119
+ - spec/spec_helper.rb