logstash-input-exec 3.3.1 → 3.3.2

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
  SHA256:
3
- metadata.gz: 60673ae805d32c1465c6fd83fe114d29532026a35c774eba83ef0a45179ecdd4
4
- data.tar.gz: aa602926b347d292cc274f50a9a30051c645670a2e2921acb492807ec8446acc
3
+ metadata.gz: 454a3fd142d85a04a0e93b3054d6f300d9dbbe7f02013485e2e58d12c5aba3d3
4
+ data.tar.gz: c2a32db4b81afc9429beee70d704b7b2cb737b08b924f813a5e91e5de4fd709d
5
5
  SHA512:
6
- metadata.gz: ff843ab17a5ef5e78a53686574524a1ed2efcfae2ebe347888d62e1119b03bd6e1e187f060adef48e7a5e382b5437784e2830aa88478cd5e471937073fb176b8
7
- data.tar.gz: b5a516f596d317264f981324e2f428fdaf9bf4daae6c7c388689315aec6c59f19678c9491558581b9ec91ef16c5014c964352fd3cf1456d59ce6f104b8d997be
6
+ metadata.gz: 983904e90f7ba90ecae393cdda1fa39abb093bc923ca82f63c70dc818b48edc36211926a6848a7c48a7547f17e0d96b7bb7a21d0f353768c064f5d2f17eab7b5
7
+ data.tar.gz: 3e7e26cde26f98fcbe1d3e0a752dec41729135c85d49720197d2a1d018c97898188bbe27fcd73290c0169d68d7263b8b6d270f6c95a8012d22a35dda47cf10b4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 3.3.2
2
+ - Fixed issue where certain log entries were incorrectly writing 'jdbc input' instead of 'exec input' [#21](https://github.com/logstash-plugins/logstash-input-exec/pull/21)
3
+
1
4
  ## 3.3.1
2
5
  - Docs: Set the default_codec doc attribute.
3
6
 
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 <<string,string>>
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 <<number,number>>
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!:
@@ -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, "jdbc input: either 'interval' or 'schedule' option must be defined."
39
+ raise LogStash::ConfigurationError, "exec input: either 'interval' or 'schedule' option must be defined."
40
40
  end
41
41
  end # def register
42
42
 
@@ -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.1'
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"
@@ -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
- it "should raise error if config is invalid" do
15
- input = LogStash::Plugin.lookup("input", "exec").new("command" => "ls")
16
- expect {input.register}.to raise_error
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) { LogStash::Plugin.lookup("input", "exec").new("command" => "ls", "interval" => 0) }
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(LogStash::Inputs::Exec).to receive(:logger).and_return(loggr).exactly(7).times
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) { LogStash::Plugin.lookup("input", "exec").new("command" => "/bin/sh -c 'sleep 1; /bin/echo -n two; exit 3'", "interval" => 0) }
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) { LogStash::Plugin.lookup("input", "exec").new("command" => "ls", "schedule" => "* * * * * UTC") }
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.1
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-04-06 00:00:00.000000000 Z
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.11
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