logstash-input-exec 3.3.1 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/docs/index.asciidoc +3 -3
- data/lib/logstash/inputs/exec.rb +1 -1
- data/logstash-input-exec.gemspec +1 -1
- data/spec/inputs/exec_spec.rb +10 -8
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 454a3fd142d85a04a0e93b3054d6f300d9dbbe7f02013485e2e58d12c5aba3d3
|
4
|
+
data.tar.gz: c2a32db4b81afc9429beee70d704b7b2cb737b08b924f813a5e91e5de4fd709d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 983904e90f7ba90ecae393cdda1fa39abb093bc923ca82f63c70dc818b48edc36211926a6848a7c48a7547f17e0d96b7bb7a21d0f353768c064f5d2f17eab7b5
|
7
|
+
data.tar.gz: 3e7e26cde26f98fcbe1d3e0a752dec41729135c85d49720197d2a1d018c97898188bbe27fcd73290c0169d68d7263b8b6d270f6c95a8012d22a35dda47cf10b4
|
data/CHANGELOG.md
CHANGED
data/docs/index.asciidoc
CHANGED
@@ -74,7 +74,7 @@ Command to run. For example, `uptime`
|
|
74
74
|
[id="plugins-{type}s-{plugin}-interval"]
|
75
75
|
===== `interval`
|
76
76
|
|
77
|
-
* Value type is <<
|
77
|
+
* Value type is <<number,number>>
|
78
78
|
* There is no default value for this setting.
|
79
79
|
|
80
80
|
Interval to run the command. Value is in seconds.
|
@@ -84,7 +84,7 @@ Either `interval` or `schedule` option must be defined.
|
|
84
84
|
[id="plugins-{type}s-{plugin}-schedule"]
|
85
85
|
===== `schedule`
|
86
86
|
|
87
|
-
* Value type is <<
|
87
|
+
* Value type is <<string,string>>
|
88
88
|
* There is no default value for this setting.
|
89
89
|
|
90
90
|
Schedule of when to periodically run command.
|
@@ -108,4 +108,4 @@ Either `interval` or `schedule` option must be defined.
|
|
108
108
|
[id="plugins-{type}s-{plugin}-common-options"]
|
109
109
|
include::{include_path}/{type}.asciidoc[]
|
110
110
|
|
111
|
-
:default_codec!:
|
111
|
+
:default_codec!:
|
data/lib/logstash/inputs/exec.rb
CHANGED
@@ -36,7 +36,7 @@ class LogStash::Inputs::Exec < LogStash::Inputs::Base
|
|
36
36
|
@io = nil
|
37
37
|
|
38
38
|
if (@interval.nil? && @schedule.nil?) || (@interval && @schedule)
|
39
|
-
raise LogStash::ConfigurationError, "
|
39
|
+
raise LogStash::ConfigurationError, "exec input: either 'interval' or 'schedule' option must be defined."
|
40
40
|
end
|
41
41
|
end # def register
|
42
42
|
|
data/logstash-input-exec.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-input-exec'
|
4
|
-
s.version = '3.3.
|
4
|
+
s.version = '3.3.2'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Captures the output of a shell command as an event"
|
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/logstash-plugin install gemname. This gem is not a stand-alone program"
|
data/spec/inputs/exec_spec.rb
CHANGED
@@ -6,24 +6,26 @@ require_relative "../spec_helper"
|
|
6
6
|
describe LogStash::Inputs::Exec do
|
7
7
|
|
8
8
|
context "when register" do
|
9
|
+
let(:input) { described_class.new("command" => "ls", "interval" => 0) }
|
9
10
|
it "should not raise error if config is valid" do
|
10
|
-
input = LogStash::Plugin.lookup("input", "exec").new("command" => "ls", "interval" => 0)
|
11
11
|
# register will try to load jars and raise if it cannot find jars or if org.apache.log4j.spi.LoggingEvent class is not present
|
12
12
|
expect {input.register}.to_not raise_error
|
13
13
|
end
|
14
|
-
|
15
|
-
input
|
16
|
-
|
14
|
+
context "with an invalid config" do
|
15
|
+
let(:input) { described_class.new("command" => "ls") }
|
16
|
+
it "should raise error" do
|
17
|
+
expect {input.register}.to raise_error(LogStash::ConfigurationError)
|
18
|
+
end
|
17
19
|
end
|
18
20
|
end
|
19
21
|
|
20
22
|
context "when operating normally" do
|
21
|
-
let(:input) {
|
23
|
+
let(:input) { described_class.new("command" => "ls", "interval" => 0) }
|
22
24
|
let(:queue) { [] }
|
23
25
|
let(:loggr) { double('loggr') }
|
24
26
|
|
25
27
|
before :each do
|
26
|
-
expect(
|
28
|
+
expect(described_class).to receive(:logger).and_return(loggr).exactly(7).times
|
27
29
|
allow(loggr).to receive(:info)
|
28
30
|
allow(loggr).to receive(:info?)
|
29
31
|
allow(loggr).to receive(:warn)
|
@@ -43,7 +45,7 @@ describe LogStash::Inputs::Exec do
|
|
43
45
|
end
|
44
46
|
|
45
47
|
context "when a command runs normally" do
|
46
|
-
let(:input) {
|
48
|
+
let(:input) { described_class.new("command" => "/bin/sh -c 'sleep 1; /bin/echo -n two; exit 3'", "interval" => 0) }
|
47
49
|
let(:queue) { [] }
|
48
50
|
|
49
51
|
before do
|
@@ -68,7 +70,7 @@ describe LogStash::Inputs::Exec do
|
|
68
70
|
end
|
69
71
|
|
70
72
|
context "when scheduling" do
|
71
|
-
let(:input) {
|
73
|
+
let(:input) { described_class.new("command" => "ls", "schedule" => "* * * * * UTC") }
|
72
74
|
let(:queue) { [] }
|
73
75
|
|
74
76
|
before do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-exec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
143
|
rubyforge_project:
|
144
|
-
rubygems_version: 2.6.
|
144
|
+
rubygems_version: 2.6.13
|
145
145
|
signing_key:
|
146
146
|
specification_version: 4
|
147
147
|
summary: Captures the output of a shell command as an event
|