logstash-input-example 0.1.2 → 2.0.1

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: 399bf5baedbc764a2994daef0f2618c796190c09
4
- data.tar.gz: 6bd14eebd6ede2198c696eac547495074405d516
3
+ metadata.gz: c5999dde7d210b23efff39d05df637db9bedf890
4
+ data.tar.gz: bbf03a9d443c127aab524ecd778ee9e66dfbfb59
5
5
  SHA512:
6
- metadata.gz: 8ef39048ac18612fe8b64a8dcc37752043b7a09ac87858d0ea390b0638d710d106b79f47d1117a8bfbb081592e8a779fb9eb004c6075890159af30520c4e98a5
7
- data.tar.gz: 1104960b8f2bf897c2cc0d3a691f96c8d4816a366b5c18d24931de3e69c3ed29f1eb4bb23cdc385a1d1c0a9d1276a0e68566fa76c27e2e492654ebb41461dd54
6
+ metadata.gz: deeeb195e1a31a7ab102329ab101afac0092c0f5b1451af801300627b22f11e4e2daa63ab9b58c0b6033d9a719609f348004fabc4fb39a945692be7465087b80
7
+ data.tar.gz: 2601d27feca6808c336c4327c9e9085744bbd24fc30cd44d8637d58d390b4274a1e3f15c277eb8734f9914efd249b03742ee0a4c85f655c5fa11a657cc145892
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## 2.0.0
2
+ - Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
3
+ instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
4
+ - Dependency on logstash-core update to 2.0
5
+
data/Gemfile CHANGED
@@ -1,2 +1,2 @@
1
1
  source 'https://rubygems.org'
2
- gemspec
2
+ gemspec
data/NOTICE.TXT ADDED
@@ -0,0 +1,5 @@
1
+ Elasticsearch
2
+ Copyright 2012-2015 Elasticsearch
3
+
4
+ This product includes software developed by The Apache Software
5
+ Foundation (http://www.apache.org/).
data/README.md CHANGED
@@ -1,19 +1,19 @@
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
 
16
- Need help? Try #logstash on freenode IRC or the logstash-users@googlegroups.com mailing list.
16
+ Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/logstash discussion forum.
17
17
 
18
18
  ## Developing
19
19
 
@@ -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.
@@ -12,7 +12,7 @@ class LogStash::Inputs::Example < LogStash::Inputs::Base
12
12
  config_name "example"
13
13
 
14
14
  # If undefined, Logstash will complain, even if codec is unused.
15
- default :codec, "plain"
15
+ default :codec, "plain"
16
16
 
17
17
  # The message string to use in the event.
18
18
  config :message, :validate => :string, :default => "Hello World!"
@@ -28,6 +28,13 @@ class LogStash::Inputs::Example < LogStash::Inputs::Base
28
28
  end # def register
29
29
 
30
30
  def run(queue)
31
+ # This plugin uses Stud.interval. Because we want it to be able to stop
32
+ # cleanly, we need to keep access to the current thread. It is referenced
33
+ # in the stop method below.
34
+ #
35
+ # Other plugins may require similar access to the current thread.
36
+ @thread = Thread.current
37
+
31
38
  Stud.interval(@interval) do
32
39
  event = LogStash::Event.new("message" => @message, "host" => @host)
33
40
  decorate(event)
@@ -35,4 +42,7 @@ class LogStash::Inputs::Example < LogStash::Inputs::Base
35
42
  end # loop
36
43
  end # def run
37
44
 
38
- end # class LogStash::Inputs::Example
45
+ def stop
46
+ Stud.stop!(@thread)
47
+ end
48
+ end # class LogStash::Inputs::Example
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-example'
3
- s.version = '0.1.2'
3
+ s.version = '2.0.1'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = "This example input streams a string at a definable interval."
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/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
14
14
  # Tests
15
15
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
16
16
 
@@ -18,8 +18,8 @@ Gem::Specification.new do |s|
18
18
  s.metadata = { "logstash_plugin" => "true", "logstash_group" => "input" }
19
19
 
20
20
  # Gem dependencies
21
- s.add_runtime_dependency "logstash-core", '>= 1.4.0', '< 2.0.0'
21
+ s.add_runtime_dependency "logstash-core", ">= 2.0.0.snapshot", "< 3.0.0"
22
22
  s.add_runtime_dependency 'logstash-codec-plain'
23
- s.add_runtime_dependency 'stud'
24
- s.add_development_dependency 'logstash-devutils'
25
- end
23
+ s.add_runtime_dependency 'stud', '>= 0.0.22'
24
+ s.add_development_dependency 'logstash-devutils', '>= 0.0.16'
25
+ end
@@ -1 +1,10 @@
1
- require "logstash/devutils/rspec/spec_helper"
1
+ require "logstash/devutils/rspec/spec_helper"
2
+ require "logstash/inputs/example"
3
+
4
+ describe LogStash::Inputs::Example do
5
+
6
+ it_behaves_like "an interruptible input plugin" do
7
+ let(:config) { { "interval" => 100 } }
8
+ end
9
+
10
+ end
metadata CHANGED
@@ -1,24 +1,24 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-example
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-20 00:00:00.000000000 Z
11
+ date: 2015-10-08 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
17
  - !ruby/object:Gem::Version
18
- version: 1.4.0
18
+ version: 2.0.0.snapshot
19
19
  - - <
20
20
  - !ruby/object:Gem::Version
21
- version: 2.0.0
21
+ version: 3.0.0
22
22
  name: logstash-core
23
23
  prerelease: false
24
24
  type: :runtime
@@ -26,10 +26,10 @@ dependencies:
26
26
  requirements:
27
27
  - - '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 1.4.0
29
+ version: 2.0.0.snapshot
30
30
  - - <
31
31
  - !ruby/object:Gem::Version
32
- version: 2.0.0
32
+ version: 3.0.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  requirement: !ruby/object:Gem::Requirement
35
35
  requirements:
@@ -49,7 +49,7 @@ dependencies:
49
49
  requirements:
50
50
  - - '>='
51
51
  - !ruby/object:Gem::Version
52
- version: '0'
52
+ version: 0.0.22
53
53
  name: stud
54
54
  prerelease: false
55
55
  type: :runtime
@@ -57,13 +57,13 @@ dependencies:
57
57
  requirements:
58
58
  - - '>='
59
59
  - !ruby/object:Gem::Version
60
- version: '0'
60
+ version: 0.0.22
61
61
  - !ruby/object:Gem::Dependency
62
62
  requirement: !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - '>='
65
65
  - !ruby/object:Gem::Version
66
- version: '0'
66
+ version: 0.0.16
67
67
  name: logstash-devutils
68
68
  prerelease: false
69
69
  type: :development
@@ -71,19 +71,19 @@ dependencies:
71
71
  requirements:
72
72
  - - '>='
73
73
  - !ruby/object:Gem::Version
74
- version: '0'
74
+ version: 0.0.16
75
75
  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
76
76
  email: info@elastic.co
77
77
  executables: []
78
78
  extensions: []
79
79
  extra_rdoc_files: []
80
80
  files:
81
- - .gitignore
81
+ - CHANGELOG.md
82
82
  - DEVELOPER.md
83
83
  - Gemfile
84
84
  - LICENSE
85
+ - NOTICE.TXT
85
86
  - README.md
86
- - Rakefile
87
87
  - lib/logstash/inputs/example.rb
88
88
  - logstash-input-example.gemspec
89
89
  - spec/inputs/example_spec.rb
@@ -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.8
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: This example input streams a string at a definable interval.
data/.gitignore DELETED
@@ -1,5 +0,0 @@
1
- *.gem
2
- Gemfile.lock
3
- Gemfile.bak
4
- .bundle
5
- vendor
data/Rakefile DELETED
@@ -1 +0,0 @@
1
- require "logstash/devutils/rake"