logstash-input-generator 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 +4 -4
- data/README.md +4 -4
- data/lib/logstash/inputs/generator.rb +3 -4
- data/logstash-input-generator.gemspec +3 -3
- data/spec/inputs/generator_spec.rb +6 -2
- metadata +17 -25
- data/.gitignore +0 -4
- data/Rakefile +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac8643c833f7cf5fb771de73159542bedcbbae92
|
4
|
+
data.tar.gz: 645b8c449d0553dcb9ec03c173da45039308253c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20088d2c464732894e58297efafeea7cd6a6d3459803e3eefb6aea75b39007fd6dcf7a23a3bd82f9f25eee8968c304239e898b197f2351a999960aa1ed699f89
|
7
|
+
data.tar.gz: 5514b8bd681bc9951bd30febc0e959ba13963d83510917be2c53e9bc23899523bc41b04c7a2488aaba2fd40108b5caa7a7dd8af924627a67706fc0a1be98bae9
|
data/README.md
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# Logstash Plugin
|
2
2
|
|
3
|
-
This is a plugin for [Logstash](https://github.com/
|
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.
|
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/
|
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/
|
86
|
+
For more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file.
|
@@ -62,7 +62,7 @@ class LogStash::Inputs::Generator < LogStash::Inputs::Threadable
|
|
62
62
|
end
|
63
63
|
@lines = [@message] if @lines.nil?
|
64
64
|
|
65
|
-
while !
|
65
|
+
while !stop? && (@count <= 0 || number < @count)
|
66
66
|
@lines.each do |line|
|
67
67
|
@codec.decode(line.clone) do |event|
|
68
68
|
decorate(event)
|
@@ -84,7 +84,7 @@ class LogStash::Inputs::Generator < LogStash::Inputs::Threadable
|
|
84
84
|
end # def run
|
85
85
|
|
86
86
|
public
|
87
|
-
def
|
87
|
+
def close
|
88
88
|
if @codec.respond_to?(:flush)
|
89
89
|
@codec.flush do |event|
|
90
90
|
decorate(event)
|
@@ -92,6 +92,5 @@ class LogStash::Inputs::Generator < LogStash::Inputs::Threadable
|
|
92
92
|
queue << event
|
93
93
|
end
|
94
94
|
end
|
95
|
-
|
96
|
-
end # def teardown
|
95
|
+
end # def close
|
97
96
|
end # class LogStash::Inputs::Generator
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-input-generator'
|
4
|
-
s.version = '
|
4
|
+
s.version = '2.0.0'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Generate random log events."
|
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 =
|
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,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",
|
23
|
+
s.add_runtime_dependency "logstash-core", "~> 2.0.0.snapshot"
|
24
24
|
|
25
25
|
s.add_runtime_dependency 'logstash-codec-plain'
|
26
26
|
s.add_development_dependency 'logstash-devutils'
|
@@ -1,7 +1,11 @@
|
|
1
1
|
require "logstash/devutils/rspec/spec_helper"
|
2
2
|
require "logstash/inputs/generator"
|
3
3
|
|
4
|
-
describe
|
4
|
+
describe LogStash::Inputs::Generator do
|
5
|
+
|
6
|
+
it_behaves_like "an interruptible input plugin" do
|
7
|
+
let(:config) { { } }
|
8
|
+
end
|
5
9
|
|
6
10
|
it "should generate configured message" do
|
7
11
|
conf = <<-CONFIG
|
@@ -37,7 +41,7 @@ describe "inputs/generator" do
|
|
37
41
|
saved_stdin = $stdin
|
38
42
|
stdin_mock = StringIO.new
|
39
43
|
$stdin = stdin_mock
|
40
|
-
stdin_mock.
|
44
|
+
expect(stdin_mock).to receive(:readline).once.and_return("bar")
|
41
45
|
|
42
46
|
events = input(conf) do |pipeline, queue|
|
43
47
|
2.times.map{queue.pop}
|
metadata
CHANGED
@@ -1,77 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
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-
|
11
|
+
date: 2015-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: logstash-core
|
15
|
-
version_requirements: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '>='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 1.4.0
|
20
|
-
- - <
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 2.0.0
|
23
14
|
requirement: !ruby/object:Gem::Requirement
|
24
15
|
requirements:
|
25
|
-
- -
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: 1.4.0
|
28
|
-
- - <
|
16
|
+
- - ~>
|
29
17
|
- !ruby/object:Gem::Version
|
30
|
-
version: 2.0.0
|
18
|
+
version: 2.0.0.snapshot
|
19
|
+
name: logstash-core
|
31
20
|
prerelease: false
|
32
21
|
type: :runtime
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: logstash-codec-plain
|
35
22
|
version_requirements: !ruby/object:Gem::Requirement
|
36
23
|
requirements:
|
37
|
-
- -
|
24
|
+
- - ~>
|
38
25
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
26
|
+
version: 2.0.0.snapshot
|
27
|
+
- !ruby/object:Gem::Dependency
|
40
28
|
requirement: !ruby/object:Gem::Requirement
|
41
29
|
requirements:
|
42
30
|
- - '>='
|
43
31
|
- !ruby/object:Gem::Version
|
44
32
|
version: '0'
|
33
|
+
name: logstash-codec-plain
|
45
34
|
prerelease: false
|
46
35
|
type: :runtime
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: logstash-devutils
|
49
36
|
version_requirements: !ruby/object:Gem::Requirement
|
50
37
|
requirements:
|
51
38
|
- - '>='
|
52
39
|
- !ruby/object:Gem::Version
|
53
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
54
42
|
requirement: !ruby/object:Gem::Requirement
|
55
43
|
requirements:
|
56
44
|
- - '>='
|
57
45
|
- !ruby/object:Gem::Version
|
58
46
|
version: '0'
|
47
|
+
name: logstash-devutils
|
59
48
|
prerelease: false
|
60
49
|
type: :development
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
61
55
|
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
|
62
56
|
email: info@elastic.co
|
63
57
|
executables: []
|
64
58
|
extensions: []
|
65
59
|
extra_rdoc_files: []
|
66
60
|
files:
|
67
|
-
- .gitignore
|
68
61
|
- CHANGELOG.md
|
69
62
|
- CONTRIBUTORS
|
70
63
|
- Gemfile
|
71
64
|
- LICENSE
|
72
65
|
- NOTICE.TXT
|
73
66
|
- README.md
|
74
|
-
- Rakefile
|
75
67
|
- lib/logstash/inputs/generator.rb
|
76
68
|
- logstash-input-generator.gemspec
|
77
69
|
- spec/inputs/generator_spec.rb
|
@@ -97,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
89
|
version: '0'
|
98
90
|
requirements: []
|
99
91
|
rubyforge_project:
|
100
|
-
rubygems_version: 2.
|
92
|
+
rubygems_version: 2.4.8
|
101
93
|
signing_key:
|
102
94
|
specification_version: 4
|
103
95
|
summary: Generate random log events.
|
data/.gitignore
DELETED