logstash-core 5.0.0.alpha3.snapshot4-java → 5.0.0.alpha3.snapshot5-java
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.
Potentially problematic release.
This version of logstash-core might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/logstash-core/version.rb +1 -1
- data/lib/logstash/agent.rb +1 -2
- data/lib/logstash/environment.rb +0 -1
- data/lib/logstash/pipeline.rb +3 -11
- data/lib/logstash/runner.rb +8 -0
- data/lib/logstash/version.rb +1 -1
- data/logstash-core.gemspec +1 -1
- data/spec/logstash/agent_spec.rb +8 -0
- data/spec/logstash/pipeline_reporter_spec.rb +5 -1
- data/spec/logstash/pipeline_spec.rb +16 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a41edc5a19188510be8f6b9e275f26d82538f4f
|
4
|
+
data.tar.gz: e389c454d1999160f6b2a1a750999ef26c620285
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5871edf304c92f16a0bc33381894d497a06189fefc0858190d9b0a888db939074c14c515432727c4cfcdfba65159b898e2a1a42438ef40683bf507b122ffa46
|
7
|
+
data.tar.gz: 6e30b256b36652be4499ab4398bab002c34d68fe92b67e65b2fd04d9f89e42a21a13591f79ba4396a891b27890405d1073950b7e87d171fe7ac98902e794606d
|
data/lib/logstash/agent.rb
CHANGED
@@ -45,7 +45,7 @@ class LogStash::Agent
|
|
45
45
|
|
46
46
|
@collect_metric = setting("metric.collect")
|
47
47
|
@metric = create_metric_collector
|
48
|
-
@periodic_pollers = LogStash::Instrument::PeriodicPollers.new(
|
48
|
+
@periodic_pollers = LogStash::Instrument::PeriodicPollers.new(create_metric_collector)
|
49
49
|
end
|
50
50
|
|
51
51
|
def execute
|
@@ -83,7 +83,6 @@ class LogStash::Agent
|
|
83
83
|
|
84
84
|
pipeline = create_pipeline(pipeline_settings)
|
85
85
|
return unless pipeline.is_a?(LogStash::Pipeline)
|
86
|
-
pipeline.metric = @metric
|
87
86
|
if @auto_reload && pipeline.non_reloadable_plugins.any?
|
88
87
|
@logger.error(I18n.t("logstash.agent.non_reloadable_config_register"),
|
89
88
|
:pipeline_id => pipeline_id,
|
data/lib/logstash/environment.rb
CHANGED
@@ -13,7 +13,6 @@ module LogStash
|
|
13
13
|
Setting::Boolean.new("config.reload.automatic", false),
|
14
14
|
Setting::Numeric.new("config.reload.interval", 3),
|
15
15
|
Setting::Boolean.new("metric.collect", true) {|v| v == true }, # metric collection cannot be disabled
|
16
|
-
Setting::String.new("path.settings", ::File.join(Environment::LOGSTASH_HOME, "config")),
|
17
16
|
Setting::String.new("pipeline.id", "main"),
|
18
17
|
Setting::Numeric.new("pipeline.workers", LogStash::Config::CpuCoreStrategy.maximum),
|
19
18
|
Setting::Numeric.new("pipeline.output.workers", 1),
|
data/lib/logstash/pipeline.rb
CHANGED
@@ -54,17 +54,9 @@ module LogStash; class Pipeline
|
|
54
54
|
|
55
55
|
@worker_threads = []
|
56
56
|
|
57
|
-
# Metric object should be passed upstream, multiple pipeline share the same metric
|
58
|
-
# and collector only the namespace will changes.
|
59
|
-
# If no metric is given, we use a `NullMetric` for all internal calls.
|
60
|
-
# We also do this to make the changes backward compatible with previous testing of the
|
61
|
-
# pipeline.
|
62
|
-
#
|
63
57
|
# This needs to be configured before we evaluate the code to make
|
64
|
-
# sure the metric instance is correctly send to the
|
65
|
-
|
66
|
-
# if there's an intent of this not being a NullMetric
|
67
|
-
@metric = Instrument::NullMetric.new
|
58
|
+
# sure the metric instance is correctly send to the plugins to make the namespace scoping work
|
59
|
+
@metric = settings.get_value("metric.collect") ? Instrument::Metric.new : Instrument::NullMetric.new
|
68
60
|
|
69
61
|
grammar = LogStashConfigParser.new
|
70
62
|
@config = grammar.parse(config_str)
|
@@ -80,7 +72,7 @@ module LogStash; class Pipeline
|
|
80
72
|
# The config code is hard to represent as a log message...
|
81
73
|
# So just print it.
|
82
74
|
|
83
|
-
if @settings.
|
75
|
+
if @settings.get_value("config.debug") && logger.debug?
|
84
76
|
logger.debug("Compiled pipeline code", :code => code)
|
85
77
|
end
|
86
78
|
|
data/lib/logstash/runner.rb
CHANGED
@@ -15,8 +15,14 @@ require "logstash/agent"
|
|
15
15
|
require "logstash/config/defaults"
|
16
16
|
require "logstash/shutdown_watcher"
|
17
17
|
require "logstash/patches/clamp"
|
18
|
+
require "logstash/settings"
|
18
19
|
|
19
20
|
class LogStash::Runner < Clamp::StrictCommand
|
21
|
+
# The `path.settings` need to be defined in the runner instead of the `logstash-core/lib/logstash/environment.r`
|
22
|
+
# because the `Environment::LOGSTASH_HOME` doesn't exist in the context of the `logstash-core` gem.
|
23
|
+
#
|
24
|
+
# See issues https://github.com/elastic/logstash/issues/5361
|
25
|
+
LogStash::SETTINGS.register(LogStash::Setting::String.new("path.settings", ::File.join(LogStash::Environment::LOGSTASH_HOME, "config")))
|
20
26
|
|
21
27
|
# Node Settings
|
22
28
|
option ["-n", "--node.name"], "NAME",
|
@@ -129,7 +135,9 @@ class LogStash::Runner < Clamp::StrictCommand
|
|
129
135
|
|
130
136
|
def run(args)
|
131
137
|
settings_path = fetch_settings_path(args)
|
138
|
+
|
132
139
|
@settings.set("path.settings", settings_path) if settings_path
|
140
|
+
|
133
141
|
LogStash::SETTINGS.from_yaml(LogStash::SETTINGS.get("path.settings"))
|
134
142
|
super(*[args])
|
135
143
|
end
|
data/lib/logstash/version.rb
CHANGED
data/logstash-core.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.require_paths = ["lib"]
|
18
18
|
gem.version = LOGSTASH_CORE_VERSION.gsub(/-/, '.')
|
19
19
|
|
20
|
-
gem.add_runtime_dependency "logstash-core-event-java", "5.0.0.alpha3.
|
20
|
+
gem.add_runtime_dependency "logstash-core-event-java", "5.0.0.alpha3.snapshot5"
|
21
21
|
|
22
22
|
gem.add_runtime_dependency "cabin", "~> 0.8.0" #(Apache 2.0 license)
|
23
23
|
gem.add_runtime_dependency "pry", "~> 0.10.1" #(Ruby license)
|
data/spec/logstash/agent_spec.rb
CHANGED
@@ -98,6 +98,7 @@ describe LogStash::Agent do
|
|
98
98
|
sleep 0.1
|
99
99
|
Stud.stop!(t)
|
100
100
|
t.join
|
101
|
+
subject.shutdown
|
101
102
|
end
|
102
103
|
end
|
103
104
|
|
@@ -114,6 +115,7 @@ describe LogStash::Agent do
|
|
114
115
|
sleep 0.1
|
115
116
|
Stud.stop!(t)
|
116
117
|
t.join
|
118
|
+
subject.shutdown
|
117
119
|
end
|
118
120
|
end
|
119
121
|
|
@@ -129,6 +131,8 @@ describe LogStash::Agent do
|
|
129
131
|
sleep 0.1
|
130
132
|
Stud.stop!(t)
|
131
133
|
t.join
|
134
|
+
|
135
|
+
subject.shutdown
|
132
136
|
end
|
133
137
|
end
|
134
138
|
end
|
@@ -157,6 +161,7 @@ describe LogStash::Agent do
|
|
157
161
|
sleep 0.1
|
158
162
|
Stud.stop!(t)
|
159
163
|
t.join
|
164
|
+
subject.shutdown
|
160
165
|
end
|
161
166
|
end
|
162
167
|
|
@@ -172,6 +177,7 @@ describe LogStash::Agent do
|
|
172
177
|
sleep 0.1
|
173
178
|
Stud.stop!(t)
|
174
179
|
t.join
|
180
|
+
subject.shutdown
|
175
181
|
end
|
176
182
|
end
|
177
183
|
|
@@ -186,6 +192,7 @@ describe LogStash::Agent do
|
|
186
192
|
sleep 0.1
|
187
193
|
Stud.stop!(t)
|
188
194
|
t.join
|
195
|
+
subject.shutdown
|
189
196
|
end
|
190
197
|
end
|
191
198
|
end
|
@@ -361,6 +368,7 @@ describe LogStash::Agent do
|
|
361
368
|
end
|
362
369
|
|
363
370
|
after :each do
|
371
|
+
subject.shutdown
|
364
372
|
Stud.stop!(@t)
|
365
373
|
@t.join
|
366
374
|
end
|
@@ -47,6 +47,10 @@ describe LogStash::PipelineReporter do
|
|
47
47
|
@post_snapshot = reporter.snapshot
|
48
48
|
end
|
49
49
|
|
50
|
+
after do
|
51
|
+
pipeline.shutdown
|
52
|
+
end
|
53
|
+
|
50
54
|
describe "events filtered" do
|
51
55
|
it "should start at zero" do
|
52
56
|
expect(@pre_snapshot.events_filtered).to eql(0)
|
@@ -82,4 +86,4 @@ describe LogStash::PipelineReporter do
|
|
82
86
|
expect(@post_snapshot.output_info.first[:events_received]).to eql(generator_count)
|
83
87
|
end
|
84
88
|
end
|
85
|
-
end
|
89
|
+
end
|
@@ -155,6 +155,7 @@ describe LogStash::Pipeline do
|
|
155
155
|
{:count_was=>worker_thread_count, :filters=>["dummyfilter"]})
|
156
156
|
pipeline.run
|
157
157
|
expect(pipeline.worker_threads.size).to eq(safe_thread_count)
|
158
|
+
pipeline.shutdown
|
158
159
|
end
|
159
160
|
end
|
160
161
|
|
@@ -168,6 +169,7 @@ describe LogStash::Pipeline do
|
|
168
169
|
{:worker_threads=> override_thread_count, :filters=>["dummyfilter"]})
|
169
170
|
pipeline.run
|
170
171
|
expect(pipeline.worker_threads.size).to eq(override_thread_count)
|
172
|
+
pipeline.shutdown
|
171
173
|
end
|
172
174
|
end
|
173
175
|
end
|
@@ -193,6 +195,7 @@ describe LogStash::Pipeline do
|
|
193
195
|
pipeline = TestPipeline.new(test_config_with_filters)
|
194
196
|
pipeline.run
|
195
197
|
expect(pipeline.worker_threads.size).to eq(worker_thread_count)
|
198
|
+
pipeline.shutdown
|
196
199
|
end
|
197
200
|
end
|
198
201
|
end
|
@@ -239,6 +242,7 @@ describe LogStash::Pipeline do
|
|
239
242
|
expect(pipeline.outputs.size ).to eq(1)
|
240
243
|
expect(pipeline.outputs.first.workers.size ).to eq(::LogStash::SETTINGS.get("pipeline.output.workers"))
|
241
244
|
expect(pipeline.outputs.first.workers.first.num_closes ).to eq(1)
|
245
|
+
pipeline.shutdown
|
242
246
|
end
|
243
247
|
|
244
248
|
it "should call output close correctly with output workers" do
|
@@ -255,6 +259,7 @@ describe LogStash::Pipeline do
|
|
255
259
|
output_delegator.workers.each do |plugin|
|
256
260
|
expect(plugin.num_closes ).to eq(1)
|
257
261
|
end
|
262
|
+
pipeline.shutdown
|
258
263
|
end
|
259
264
|
end
|
260
265
|
end
|
@@ -276,6 +281,7 @@ describe LogStash::Pipeline do
|
|
276
281
|
expect(pipeline).to receive(:start_flusher).ordered.and_call_original
|
277
282
|
|
278
283
|
pipeline.run
|
284
|
+
pipeline.shutdown
|
279
285
|
end
|
280
286
|
end
|
281
287
|
|
@@ -392,8 +398,14 @@ describe LogStash::Pipeline do
|
|
392
398
|
output { }
|
393
399
|
CONFIG
|
394
400
|
|
395
|
-
it "uses a `NullMetric` object if
|
396
|
-
|
401
|
+
it "uses a `NullMetric` object if `metric.collect` is set to false" do
|
402
|
+
settings = double("LogStash::SETTINGS")
|
403
|
+
|
404
|
+
allow(settings).to receive(:get_value).with("pipeline.id").and_return("main")
|
405
|
+
allow(settings).to receive(:get_value).with("metric.collect").and_return(false)
|
406
|
+
allow(settings).to receive(:get_value).with("config.debug").and_return(false)
|
407
|
+
|
408
|
+
pipeline = LogStash::Pipeline.new(config, settings)
|
397
409
|
expect(pipeline.metric).to be_kind_of(LogStash::Instrument::NullMetric)
|
398
410
|
end
|
399
411
|
end
|
@@ -511,7 +523,7 @@ describe LogStash::Pipeline do
|
|
511
523
|
t = Thread.new { subject.run }
|
512
524
|
sleep(0.1)
|
513
525
|
expect(subject.started_at).to be < Time.now
|
514
|
-
|
526
|
+
subject.shutdown
|
515
527
|
end
|
516
528
|
end
|
517
529
|
|
@@ -536,7 +548,7 @@ describe LogStash::Pipeline do
|
|
536
548
|
t = Thread.new { subject.run }
|
537
549
|
sleep(0.1)
|
538
550
|
expect(subject.uptime).to be > 0
|
539
|
-
|
551
|
+
subject.shutdown
|
540
552
|
end
|
541
553
|
end
|
542
554
|
end
|
@@ -590,7 +602,6 @@ describe LogStash::Pipeline do
|
|
590
602
|
# Reset the metric store
|
591
603
|
LogStash::Instrument::Collector.instance.clear
|
592
604
|
|
593
|
-
subject.metric = metric
|
594
605
|
Thread.new { subject.run }
|
595
606
|
# make sure we have received all the generated events
|
596
607
|
sleep 1 while dummyoutput.events.size < number_of_events
|
metadata
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.0.alpha3.
|
4
|
+
version: 5.0.0.alpha3.snapshot5
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-26 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: 5.0.0.alpha3.
|
18
|
+
version: 5.0.0.alpha3.snapshot5
|
19
19
|
name: logstash-core-event-java
|
20
20
|
prerelease: false
|
21
21
|
type: :runtime
|
@@ -23,7 +23,7 @@ dependencies:
|
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 5.0.0.alpha3.
|
26
|
+
version: 5.0.0.alpha3.snapshot5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|