logstash-core 5.5.3-java → 5.6.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logstash-core/logstash-core.jar +0 -0
- data/lib/logstash-core/version.rb +1 -1
- data/lib/logstash/api/commands/node.rb +2 -2
- data/lib/logstash/api/commands/stats.rb +2 -2
- data/lib/logstash/config/config_ast.rb +24 -1
- data/lib/logstash/config/modules_common.rb +47 -15
- data/lib/logstash/config/source/modules.rb +55 -0
- data/lib/logstash/config/string_escape.rb +27 -0
- data/lib/logstash/elasticsearch_client.rb +24 -2
- data/lib/logstash/environment.rb +2 -0
- data/lib/logstash/filter_delegator.rb +9 -6
- data/lib/logstash/instrument/collector.rb +7 -5
- data/lib/logstash/instrument/metric_store.rb +11 -11
- data/lib/logstash/instrument/namespaced_metric.rb +4 -0
- data/lib/logstash/instrument/namespaced_null_metric.rb +4 -0
- data/lib/logstash/instrument/null_metric.rb +10 -0
- data/lib/logstash/instrument/periodic_poller/dlq.rb +19 -0
- data/lib/logstash/instrument/periodic_pollers.rb +3 -1
- data/lib/logstash/instrument/wrapped_write_client.rb +33 -24
- data/lib/logstash/logging/logger.rb +26 -19
- data/lib/logstash/modules/{importer.rb → elasticsearch_importer.rb} +3 -3
- data/lib/logstash/modules/kibana_base.rb +24 -0
- data/lib/logstash/modules/kibana_client.rb +124 -0
- data/lib/logstash/modules/kibana_config.rb +29 -28
- data/lib/logstash/modules/kibana_dashboards.rb +36 -0
- data/lib/logstash/modules/kibana_importer.rb +17 -0
- data/lib/logstash/modules/kibana_settings.rb +40 -0
- data/lib/logstash/modules/logstash_config.rb +89 -17
- data/lib/logstash/modules/resource_base.rb +6 -5
- data/lib/logstash/modules/scaffold.rb +11 -3
- data/lib/logstash/modules/settings_merger.rb +23 -0
- data/lib/logstash/modules/util.rb +17 -0
- data/lib/logstash/output_delegator.rb +7 -5
- data/lib/logstash/pipeline.rb +34 -2
- data/lib/logstash/runner.rb +8 -13
- data/lib/logstash/settings.rb +20 -1
- data/lib/logstash/util/wrapped_acked_queue.rb +5 -24
- data/lib/logstash/util/wrapped_synchronous_queue.rb +14 -24
- data/lib/logstash/version.rb +1 -1
- data/locales/en.yml +11 -4
- data/spec/logstash/agent_spec.rb +19 -6
- data/spec/logstash/api/modules/node_spec.rb +2 -1
- data/spec/logstash/config/config_ast_spec.rb +47 -8
- data/spec/logstash/config/string_escape_spec.rb +24 -0
- data/spec/logstash/event_spec.rb +9 -0
- data/spec/logstash/filter_delegator_spec.rb +21 -7
- data/spec/logstash/instrument/periodic_poller/dlq_spec.rb +17 -0
- data/spec/logstash/instrument/periodic_poller/jvm_spec.rb +1 -1
- data/spec/logstash/legacy_ruby_event_spec.rb +4 -4
- data/spec/logstash/modules/logstash_config_spec.rb +56 -0
- data/spec/logstash/modules/scaffold_spec.rb +234 -0
- data/spec/logstash/output_delegator_spec.rb +15 -5
- data/spec/logstash/pipeline_spec.rb +76 -26
- data/spec/logstash/runner_spec.rb +46 -25
- data/spec/logstash/settings/splittable_string_array_spec.rb +51 -0
- data/spec/logstash/util/wrapped_synchronous_queue_spec.rb +0 -22
- metadata +22 -4
- data/lib/logstash/modules/kibana_base_resource.rb +0 -10
- data/lib/logstash/program.rb +0 -14
@@ -4,10 +4,19 @@ require "logstash/execution_context"
|
|
4
4
|
require "spec_helper"
|
5
5
|
|
6
6
|
describe LogStash::OutputDelegator do
|
7
|
+
|
8
|
+
class MockGauge
|
9
|
+
def increment(_)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
7
13
|
let(:logger) { double("logger") }
|
8
14
|
let(:events) { 7.times.map { LogStash::Event.new }}
|
9
15
|
let(:plugin_args) { {"id" => "foo", "arg1" => "val1"} }
|
10
16
|
let(:collector) { [] }
|
17
|
+
let(:counter_in) { MockGauge.new }
|
18
|
+
let(:counter_out) { MockGauge.new }
|
19
|
+
let(:counter_time) { MockGauge.new }
|
11
20
|
let(:metric) { LogStash::Instrument::NamespacedNullMetric.new(collector, :null) }
|
12
21
|
let(:default_execution_context) { LogStash::ExecutionContext.new(:main, "foo", "output",
|
13
22
|
LogStash::Util::DummyDeadLetterQueueWriter.new) }
|
@@ -22,6 +31,9 @@ describe LogStash::OutputDelegator do
|
|
22
31
|
before(:each) do
|
23
32
|
# use the same metric instance
|
24
33
|
allow(metric).to receive(:namespace).with(any_args).and_return(metric)
|
34
|
+
allow(metric).to receive(:counter).with(:in).and_return(counter_in)
|
35
|
+
allow(metric).to receive(:counter).with(:out).and_return(counter_out)
|
36
|
+
allow(metric).to receive(:counter).with(:duration_in_millis).and_return(counter_time)
|
25
37
|
|
26
38
|
allow(out_klass).to receive(:new).with(any_args).and_return(out_inst)
|
27
39
|
allow(out_klass).to receive(:name).and_return("example")
|
@@ -57,15 +69,13 @@ describe LogStash::OutputDelegator do
|
|
57
69
|
end
|
58
70
|
|
59
71
|
it "should increment the number of events received" do
|
60
|
-
expect(
|
61
|
-
expect(
|
72
|
+
expect(counter_in).to receive(:increment).with(events.length)
|
73
|
+
expect(counter_out).to receive(:increment).with(events.length)
|
62
74
|
subject.multi_receive(events)
|
63
75
|
end
|
64
76
|
|
65
77
|
it "should record the `duration_in_millis`" do
|
66
|
-
|
67
|
-
expect(subject.metric_events).to receive(:time).with(:duration_in_millis).and_return(clock)
|
68
|
-
expect(clock).to receive(:stop)
|
78
|
+
expect(counter_time).to receive(:increment).with(Integer)
|
69
79
|
subject.multi_receive(events)
|
70
80
|
end
|
71
81
|
end
|
@@ -4,6 +4,8 @@ require "logstash/inputs/generator"
|
|
4
4
|
require "logstash/filters/multiline"
|
5
5
|
require_relative "../support/mocks_classes"
|
6
6
|
require_relative "../logstash/pipeline_reporter_spec" # for DummyOutput class
|
7
|
+
require "stud/try"
|
8
|
+
require 'timeout'
|
7
9
|
|
8
10
|
class DummyInput < LogStash::Inputs::Base
|
9
11
|
config_name "dummyinput"
|
@@ -103,20 +105,24 @@ describe LogStash::Pipeline do
|
|
103
105
|
let(:worker_thread_count) { 5 }
|
104
106
|
let(:safe_thread_count) { 1 }
|
105
107
|
let(:override_thread_count) { 42 }
|
106
|
-
let(:
|
108
|
+
let(:dead_letter_queue_enabled) { false }
|
109
|
+
let(:dead_letter_queue_path) { }
|
110
|
+
let(:pipeline_settings_obj) { LogStash::SETTINGS.clone }
|
107
111
|
let(:pipeline_settings) { {} }
|
112
|
+
let(:max_retry) {10} #times
|
113
|
+
let(:timeout) {120} #seconds
|
108
114
|
|
109
115
|
before :each do
|
110
116
|
pipeline_workers_setting = LogStash::SETTINGS.get_setting("pipeline.workers")
|
111
117
|
allow(pipeline_workers_setting).to receive(:default).and_return(worker_thread_count)
|
112
|
-
|
113
|
-
|
118
|
+
dlq_enabled_setting = LogStash::SETTINGS.get_setting("dead_letter_queue.enable")
|
119
|
+
allow(dlq_enabled_setting).to receive(:value).and_return(dead_letter_queue_enabled)
|
120
|
+
dlq_path_setting = LogStash::SETTINGS.get_setting("path.dead_letter_queue")
|
121
|
+
allow(dlq_path_setting).to receive(:value).and_return(dead_letter_queue_path)
|
114
122
|
|
115
|
-
|
116
|
-
pipeline_settings_obj.reset
|
123
|
+
pipeline_settings.each {|k, v| pipeline_settings_obj.set(k, v) }
|
117
124
|
end
|
118
125
|
|
119
|
-
|
120
126
|
describe "event cancellation" do
|
121
127
|
# test harness for https://github.com/elastic/logstash/issues/6055
|
122
128
|
|
@@ -155,12 +161,16 @@ describe LogStash::Pipeline do
|
|
155
161
|
|
156
162
|
pipeline = LogStash::Pipeline.new(config, pipeline_settings_obj)
|
157
163
|
t = Thread.new { pipeline.run }
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
+
Timeout.timeout(timeout) do
|
165
|
+
sleep(0.1) until pipeline.ready?
|
166
|
+
end
|
167
|
+
Stud.try(max_retry.times, [StandardError, RSpec::Expectations::ExpectationNotMetError]) do
|
168
|
+
wait(3).for do
|
169
|
+
# give us a bit of time to flush the events
|
170
|
+
# puts("*****" + output.events.map{|e| e.message}.to_s)
|
171
|
+
output.events.map{|e| e.get("message")}.include?("END")
|
172
|
+
end.to be_truthy
|
173
|
+
end
|
164
174
|
expect(output.events.size).to eq(2)
|
165
175
|
expect(output.events[0].get("tags")).to eq(["notdropped"])
|
166
176
|
expect(output.events[1].get("tags")).to eq(["notdropped"])
|
@@ -409,7 +419,9 @@ describe LogStash::Pipeline do
|
|
409
419
|
# race condition if called in the thread
|
410
420
|
p = pipeline
|
411
421
|
t = Thread.new { p.run }
|
412
|
-
|
422
|
+
Timeout.timeout(timeout) do
|
423
|
+
sleep(0.1) until pipeline.ready?
|
424
|
+
end
|
413
425
|
pipeline.shutdown
|
414
426
|
t.join
|
415
427
|
end
|
@@ -608,11 +620,15 @@ describe LogStash::Pipeline do
|
|
608
620
|
|
609
621
|
pipeline = LogStash::Pipeline.new(config, pipeline_settings_obj)
|
610
622
|
t = Thread.new { pipeline.run }
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
623
|
+
Timeout.timeout(timeout) do
|
624
|
+
sleep(0.1) until pipeline.ready?
|
625
|
+
end
|
626
|
+
Stud.try(max_retry.times, [StandardError, RSpec::Expectations::ExpectationNotMetError]) do
|
627
|
+
wait(10).for do
|
628
|
+
# give us a bit of time to flush the events
|
629
|
+
output.events.empty?
|
630
|
+
end.to be_falsey
|
631
|
+
end
|
616
632
|
|
617
633
|
expect(output.events.any? {|e| e.get("message") == "dummy_flush"}).to eq(true)
|
618
634
|
|
@@ -712,9 +728,12 @@ describe LogStash::Pipeline do
|
|
712
728
|
# subject must be first call outside the thread context because of lazy initialization
|
713
729
|
s = subject
|
714
730
|
t = Thread.new { s.run }
|
715
|
-
|
716
|
-
|
717
|
-
|
731
|
+
Timeout.timeout(timeout) do
|
732
|
+
sleep(0.1) until subject.ready?
|
733
|
+
end
|
734
|
+
Timeout.timeout(timeout) do
|
735
|
+
sleep(0.1)
|
736
|
+
end
|
718
737
|
expect(subject.uptime).to be > 0
|
719
738
|
subject.shutdown
|
720
739
|
t.join
|
@@ -778,13 +797,17 @@ describe LogStash::Pipeline do
|
|
778
797
|
allow(LogStash::Plugin).to receive(:lookup).with("output", "dummyoutput").and_return(::LogStash::Outputs::DummyOutput)
|
779
798
|
|
780
799
|
pipeline_thread
|
781
|
-
|
800
|
+
Timeout.timeout(timeout) do
|
801
|
+
sleep(0.1) until subject.ready?
|
802
|
+
end
|
782
803
|
|
783
804
|
# make sure we have received all the generated events
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
805
|
+
Stud.try(max_retry.times, [StandardError, RSpec::Expectations::ExpectationNotMetError]) do
|
806
|
+
wait(3).for do
|
807
|
+
# give us a bit of time to flush the events
|
808
|
+
dummyoutput.events.size >= number_of_events
|
809
|
+
end.to be_truthy
|
810
|
+
end
|
788
811
|
end
|
789
812
|
|
790
813
|
after :each do
|
@@ -841,6 +864,33 @@ describe LogStash::Pipeline do
|
|
841
864
|
expect(collected_metric[:stats][:pipelines][:main][:plugins][:filters][plugin_name][:name].value).to eq(LogStash::Filters::Multiline.config_name)
|
842
865
|
end
|
843
866
|
end
|
867
|
+
|
868
|
+
context 'when dlq is disabled' do
|
869
|
+
let (:collect_stats) { subject.collect_dlq_stats}
|
870
|
+
let (:collected_stats) { collected_metric[:stats][:pipelines][:main][:dlq]}
|
871
|
+
let (:available_stats) {[:path, :queue_size_in_bytes]}
|
872
|
+
|
873
|
+
it 'should show not show any dlq stats' do
|
874
|
+
collect_stats
|
875
|
+
expect(collected_stats).to be_nil
|
876
|
+
end
|
877
|
+
|
878
|
+
end
|
879
|
+
|
880
|
+
context 'when dlq is enabled' do
|
881
|
+
let (:dead_letter_queue_enabled) { true }
|
882
|
+
let (:dead_letter_queue_path) { Stud::Temporary.directory }
|
883
|
+
let (:pipeline_dlq_path) { "#{dead_letter_queue_path}/#{pipeline_id}"}
|
884
|
+
|
885
|
+
let (:collect_stats) { subject.collect_dlq_stats }
|
886
|
+
let (:collected_stats) { collected_metric[:stats][:pipelines][:main][:dlq]}
|
887
|
+
|
888
|
+
it 'should show dlq stats' do
|
889
|
+
collect_stats
|
890
|
+
# A newly created dead letter queue with no entries will have a size of 1 (the version 'header')
|
891
|
+
expect(collected_stats[:queue_size_in_bytes].value).to eq(1)
|
892
|
+
end
|
893
|
+
end
|
844
894
|
end
|
845
895
|
end
|
846
896
|
|
@@ -7,6 +7,7 @@ require "stud/temporary"
|
|
7
7
|
require "logstash/util/java_version"
|
8
8
|
require "logstash/logging/json"
|
9
9
|
require "logstash/config/modules_common"
|
10
|
+
require "logstash/modules/util"
|
10
11
|
require "logstash/elasticsearch_client"
|
11
12
|
require "json"
|
12
13
|
require_relative "../support/helpers"
|
@@ -20,6 +21,7 @@ describe LogStash::Runner do
|
|
20
21
|
|
21
22
|
subject { LogStash::Runner }
|
22
23
|
let(:logger) { double("logger") }
|
24
|
+
let(:agent) { double("agent") }
|
23
25
|
|
24
26
|
before :each do
|
25
27
|
allow(LogStash::Runner).to receive(:logger).and_return(logger)
|
@@ -34,6 +36,13 @@ describe LogStash::Runner do
|
|
34
36
|
allow(LogStash::Logging::Logger).to receive(:configure_logging) do |level, path|
|
35
37
|
allow(logger).to receive(:level).and_return(level.to_sym)
|
36
38
|
end
|
39
|
+
allow(LogStash::Logging::Logger).to receive(:reconfigure).with(any_args)
|
40
|
+
# Make sure we don't start a real pipeline here.
|
41
|
+
# because we cannot easily close the pipeline
|
42
|
+
allow(LogStash::Agent).to receive(:new).with(any_args).and_return(agent)
|
43
|
+
allow(agent).to receive(:execute)
|
44
|
+
allow(agent).to receive(:shutdown)
|
45
|
+
allow(agent).to receive(:register_pipeline)
|
37
46
|
end
|
38
47
|
|
39
48
|
describe "argument precedence" do
|
@@ -297,6 +306,9 @@ describe LogStash::Runner do
|
|
297
306
|
end
|
298
307
|
|
299
308
|
describe "config.debug" do
|
309
|
+
after(:each) do
|
310
|
+
LogStash::SETTINGS.set("config.debug", false)
|
311
|
+
end
|
300
312
|
it "should set 'config.debug' to false by default" do
|
301
313
|
expect(LogStash::Agent).to receive(:new) do |settings|
|
302
314
|
expect(settings.get("config.debug")).to eq(false)
|
@@ -316,14 +328,18 @@ describe LogStash::Runner do
|
|
316
328
|
end
|
317
329
|
|
318
330
|
describe "logstash modules" do
|
331
|
+
before(:each) do
|
332
|
+
test_modules_dir = File.expand_path(File.join(File.dirname(__FILE__), "..", "modules_test_files"))
|
333
|
+
LogStash::Modules::Util.register_local_modules(test_modules_dir)
|
334
|
+
end
|
335
|
+
|
319
336
|
describe "--config.test_and_exit" do
|
320
337
|
subject { LogStash::Runner.new("") }
|
321
338
|
let(:args) { ["-t", "--modules", module_string] }
|
322
339
|
|
323
340
|
context "with a good configuration" do
|
324
|
-
let(:module_string) { "
|
341
|
+
let(:module_string) { "tester" }
|
325
342
|
it "should exit successfully" do
|
326
|
-
skip("Skipped until cef module is added back to the codebase as explained in #7455")
|
327
343
|
expect(logger).not_to receive(:fatal)
|
328
344
|
expect(subject.run(args)).to eq(0)
|
329
345
|
end
|
@@ -339,53 +355,58 @@ describe LogStash::Runner do
|
|
339
355
|
end
|
340
356
|
|
341
357
|
describe "--modules" do
|
342
|
-
let(:args) { ["--modules", module_string] }
|
343
|
-
|
358
|
+
let(:args) { ["--modules", module_string, "--setup"] }
|
359
|
+
|
344
360
|
context "with an available module specified but no connection to elasticsearch" do
|
345
|
-
let(:module_string) { "
|
361
|
+
let(:module_string) { "tester" }
|
346
362
|
before do
|
347
363
|
expect(logger).to receive(:fatal) do |msg, hash|
|
348
364
|
expect(msg).to eq("An unexpected error occurred!")
|
349
365
|
expect(hash).to be_a_config_loading_error_hash(
|
350
|
-
/Failed to import module configurations to Elasticsearch. Module:
|
366
|
+
/Failed to import module configurations to Elasticsearch and\/or Kibana. Module: tester has/)
|
351
367
|
end
|
352
368
|
end
|
353
369
|
it "should log fatally and return a bad exit code" do
|
354
|
-
skip("Skipped until cef module is added back to the codebase as explained in #7455")
|
355
370
|
expect(subject.run("bin/logstash", args)).to eq(1)
|
356
371
|
end
|
357
372
|
end
|
358
373
|
|
359
374
|
context "with an available module specified and a mocked connection to elasticsearch" do
|
360
|
-
let(:module_string) { "
|
361
|
-
let(:
|
375
|
+
let(:module_string) { "tester" }
|
376
|
+
let(:kbn_version) { "5.6.0" }
|
377
|
+
let(:esclient) { double(:esclient) }
|
378
|
+
let(:kbnclient) { double(:kbnclient) }
|
362
379
|
let(:response) { double(:response) }
|
363
380
|
before do
|
364
381
|
allow(response).to receive(:status).and_return(404)
|
365
|
-
allow(
|
366
|
-
allow(
|
367
|
-
allow(
|
368
|
-
allow(
|
369
|
-
allow(
|
370
|
-
allow(LogStash::ElasticsearchClient).to receive(:build).and_return(
|
371
|
-
|
372
|
-
|
382
|
+
allow(esclient).to receive(:head).and_return(response)
|
383
|
+
allow(esclient).to receive(:can_connect?).and_return(true)
|
384
|
+
allow(kbnclient).to receive(:version).and_return(kbn_version)
|
385
|
+
allow(kbnclient).to receive(:version_parts).and_return(kbn_version.split('.'))
|
386
|
+
allow(kbnclient).to receive(:can_connect?).and_return(true)
|
387
|
+
allow(LogStash::ElasticsearchClient).to receive(:build).and_return(esclient)
|
388
|
+
allow(LogStash::Modules::KibanaClient).to receive(:new).and_return(kbnclient)
|
389
|
+
|
390
|
+
expect(esclient).to receive(:put).once do |path, content|
|
373
391
|
LogStash::ElasticsearchClient::Response.new(201, "", {})
|
374
392
|
end
|
375
|
-
expect(
|
393
|
+
expect(kbnclient).to receive(:post).twice do |path, content|
|
394
|
+
LogStash::Modules::KibanaClient::Response.new(201, "", {})
|
395
|
+
end
|
396
|
+
|
397
|
+
expect(LogStash::Agent).to receive(:new) do |settings, source_loader|
|
376
398
|
pipelines = LogStash::Config::ModulesCommon.pipeline_configs(settings)
|
377
399
|
expect(pipelines).not_to be_empty
|
378
|
-
|
379
|
-
expect(
|
380
|
-
expect(
|
381
|
-
expect(
|
382
|
-
|
400
|
+
module_pipeline = pipelines.first
|
401
|
+
expect(module_pipeline).to include("pipeline_id", "config_string")
|
402
|
+
expect(module_pipeline["pipeline_id"]).to include('tester')
|
403
|
+
expect(module_pipeline["config_string"]).to include('index => "tester-')
|
404
|
+
agent
|
383
405
|
end
|
384
406
|
expect(logger).not_to receive(:fatal)
|
385
407
|
expect(logger).not_to receive(:error)
|
386
408
|
end
|
387
|
-
|
388
|
-
skip("Skipped until cef module is added back to the codebase as explained in #7455")
|
409
|
+
xit "should not terminate logstash" do
|
389
410
|
expect(subject.run("bin/logstash", args)).to be_nil
|
390
411
|
end
|
391
412
|
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "spec_helper"
|
3
|
+
require "logstash/settings"
|
4
|
+
|
5
|
+
describe LogStash::Setting::SplittableStringArray do
|
6
|
+
let(:element_class) { String }
|
7
|
+
let(:default_value) { [] }
|
8
|
+
|
9
|
+
subject { described_class.new("testing", element_class, default_value) }
|
10
|
+
|
11
|
+
before do
|
12
|
+
subject.set(candidate)
|
13
|
+
end
|
14
|
+
|
15
|
+
context "when giving an array" do
|
16
|
+
let(:candidate) { ["hello,", "ninja"] }
|
17
|
+
|
18
|
+
it "returns the same elements" do
|
19
|
+
expect(subject.value).to match(candidate)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
context "when given a string" do
|
24
|
+
context "with 1 element" do
|
25
|
+
let(:candidate) { "hello" }
|
26
|
+
|
27
|
+
it "returns 1 element" do
|
28
|
+
expect(subject.value).to match(["hello"])
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context "with multiple element" do
|
33
|
+
let(:candidate) { "hello,ninja" }
|
34
|
+
|
35
|
+
it "returns an array of string" do
|
36
|
+
expect(subject.value).to match(["hello", "ninja"])
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
context "when defining a custom tokenizer" do
|
42
|
+
subject { described_class.new("testing", element_class, default_value, strict=true, ";") }
|
43
|
+
|
44
|
+
let(:candidate) { "hello;ninja" }
|
45
|
+
|
46
|
+
it "returns an array of string" do
|
47
|
+
expect(subject.value).to match(["hello", "ninja"])
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
@@ -4,28 +4,6 @@ require "logstash/util/wrapped_synchronous_queue"
|
|
4
4
|
require "logstash/instrument/collector"
|
5
5
|
|
6
6
|
describe LogStash::Util::WrappedSynchronousQueue do
|
7
|
-
context "#offer" do
|
8
|
-
context "queue is blocked" do
|
9
|
-
it "fails and give feedback" do
|
10
|
-
expect(subject.offer("Bonjour", 2)).to be_falsey
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
context "queue is not blocked" do
|
15
|
-
before do
|
16
|
-
@consumer = Thread.new { loop { subject.take } }
|
17
|
-
sleep(0.1)
|
18
|
-
end
|
19
|
-
|
20
|
-
after do
|
21
|
-
@consumer.kill
|
22
|
-
end
|
23
|
-
|
24
|
-
it "inserts successfully" do
|
25
|
-
expect(subject.offer("Bonjour", 20)).to be_truthy
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
7
|
|
30
8
|
describe "queue clients" do
|
31
9
|
context "when requesting a write client" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.6.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Elastic
|
@@ -371,6 +371,8 @@ files:
|
|
371
371
|
- lib/logstash/config/loader.rb
|
372
372
|
- lib/logstash/config/mixin.rb
|
373
373
|
- lib/logstash/config/modules_common.rb
|
374
|
+
- lib/logstash/config/source/modules.rb
|
375
|
+
- lib/logstash/config/string_escape.rb
|
374
376
|
- lib/logstash/elasticsearch_client.rb
|
375
377
|
- lib/logstash/environment.rb
|
376
378
|
- lib/logstash/errors.rb
|
@@ -395,6 +397,7 @@ files:
|
|
395
397
|
- lib/logstash/instrument/null_metric.rb
|
396
398
|
- lib/logstash/instrument/periodic_poller/base.rb
|
397
399
|
- lib/logstash/instrument/periodic_poller/cgroup.rb
|
400
|
+
- lib/logstash/instrument/periodic_poller/dlq.rb
|
398
401
|
- lib/logstash/instrument/periodic_poller/jvm.rb
|
399
402
|
- lib/logstash/instrument/periodic_poller/load_average.rb
|
400
403
|
- lib/logstash/instrument/periodic_poller/os.rb
|
@@ -409,15 +412,21 @@ files:
|
|
409
412
|
- lib/logstash/logging/logger.rb
|
410
413
|
- lib/logstash/modules/cli_parser.rb
|
411
414
|
- lib/logstash/modules/elasticsearch_config.rb
|
415
|
+
- lib/logstash/modules/elasticsearch_importer.rb
|
412
416
|
- lib/logstash/modules/elasticsearch_resource.rb
|
413
417
|
- lib/logstash/modules/file_reader.rb
|
414
|
-
- lib/logstash/modules/
|
415
|
-
- lib/logstash/modules/
|
418
|
+
- lib/logstash/modules/kibana_base.rb
|
419
|
+
- lib/logstash/modules/kibana_client.rb
|
416
420
|
- lib/logstash/modules/kibana_config.rb
|
421
|
+
- lib/logstash/modules/kibana_dashboards.rb
|
422
|
+
- lib/logstash/modules/kibana_importer.rb
|
417
423
|
- lib/logstash/modules/kibana_resource.rb
|
424
|
+
- lib/logstash/modules/kibana_settings.rb
|
418
425
|
- lib/logstash/modules/logstash_config.rb
|
419
426
|
- lib/logstash/modules/resource_base.rb
|
420
427
|
- lib/logstash/modules/scaffold.rb
|
428
|
+
- lib/logstash/modules/settings_merger.rb
|
429
|
+
- lib/logstash/modules/util.rb
|
421
430
|
- lib/logstash/namespace.rb
|
422
431
|
- lib/logstash/output_delegator.rb
|
423
432
|
- lib/logstash/output_delegator_strategies/legacy.rb
|
@@ -439,7 +448,6 @@ files:
|
|
439
448
|
- lib/logstash/plugin.rb
|
440
449
|
- lib/logstash/plugins/hooks_registry.rb
|
441
450
|
- lib/logstash/plugins/registry.rb
|
442
|
-
- lib/logstash/program.rb
|
443
451
|
- lib/logstash/queue_factory.rb
|
444
452
|
- lib/logstash/runner.rb
|
445
453
|
- lib/logstash/settings.rb
|
@@ -492,6 +500,7 @@ files:
|
|
492
500
|
- spec/logstash/config/defaults_spec.rb
|
493
501
|
- spec/logstash/config/loader_spec.rb
|
494
502
|
- spec/logstash/config/mixin_spec.rb
|
503
|
+
- spec/logstash/config/string_escape_spec.rb
|
495
504
|
- spec/logstash/environment_spec.rb
|
496
505
|
- spec/logstash/event_dispatcher_spec.rb
|
497
506
|
- spec/logstash/event_spec.rb
|
@@ -509,6 +518,7 @@ files:
|
|
509
518
|
- spec/logstash/instrument/null_metric_spec.rb
|
510
519
|
- spec/logstash/instrument/periodic_poller/base_spec.rb
|
511
520
|
- spec/logstash/instrument/periodic_poller/cgroup_spec.rb
|
521
|
+
- spec/logstash/instrument/periodic_poller/dlq_spec.rb
|
512
522
|
- spec/logstash/instrument/periodic_poller/jvm_spec.rb
|
513
523
|
- spec/logstash/instrument/periodic_poller/load_average_spec.rb
|
514
524
|
- spec/logstash/instrument/periodic_poller/os_spec.rb
|
@@ -517,6 +527,8 @@ files:
|
|
517
527
|
- spec/logstash/json_spec.rb
|
518
528
|
- spec/logstash/legacy_ruby_event_spec.rb
|
519
529
|
- spec/logstash/legacy_ruby_timestamp_spec.rb
|
530
|
+
- spec/logstash/modules/logstash_config_spec.rb
|
531
|
+
- spec/logstash/modules/scaffold_spec.rb
|
520
532
|
- spec/logstash/output_delegator_spec.rb
|
521
533
|
- spec/logstash/outputs/base_spec.rb
|
522
534
|
- spec/logstash/patches_spec.rb
|
@@ -535,6 +547,7 @@ files:
|
|
535
547
|
- spec/logstash/settings/integer_spec.rb
|
536
548
|
- spec/logstash/settings/numeric_spec.rb
|
537
549
|
- spec/logstash/settings/port_range_spec.rb
|
550
|
+
- spec/logstash/settings/splittable_string_array_spec.rb
|
538
551
|
- spec/logstash/settings/string_spec.rb
|
539
552
|
- spec/logstash/settings/time_value_spec.rb
|
540
553
|
- spec/logstash/settings/writable_directory_spec.rb
|
@@ -610,6 +623,7 @@ test_files:
|
|
610
623
|
- spec/logstash/config/defaults_spec.rb
|
611
624
|
- spec/logstash/config/loader_spec.rb
|
612
625
|
- spec/logstash/config/mixin_spec.rb
|
626
|
+
- spec/logstash/config/string_escape_spec.rb
|
613
627
|
- spec/logstash/environment_spec.rb
|
614
628
|
- spec/logstash/event_dispatcher_spec.rb
|
615
629
|
- spec/logstash/event_spec.rb
|
@@ -627,6 +641,7 @@ test_files:
|
|
627
641
|
- spec/logstash/instrument/null_metric_spec.rb
|
628
642
|
- spec/logstash/instrument/periodic_poller/base_spec.rb
|
629
643
|
- spec/logstash/instrument/periodic_poller/cgroup_spec.rb
|
644
|
+
- spec/logstash/instrument/periodic_poller/dlq_spec.rb
|
630
645
|
- spec/logstash/instrument/periodic_poller/jvm_spec.rb
|
631
646
|
- spec/logstash/instrument/periodic_poller/load_average_spec.rb
|
632
647
|
- spec/logstash/instrument/periodic_poller/os_spec.rb
|
@@ -635,6 +650,8 @@ test_files:
|
|
635
650
|
- spec/logstash/json_spec.rb
|
636
651
|
- spec/logstash/legacy_ruby_event_spec.rb
|
637
652
|
- spec/logstash/legacy_ruby_timestamp_spec.rb
|
653
|
+
- spec/logstash/modules/logstash_config_spec.rb
|
654
|
+
- spec/logstash/modules/scaffold_spec.rb
|
638
655
|
- spec/logstash/output_delegator_spec.rb
|
639
656
|
- spec/logstash/outputs/base_spec.rb
|
640
657
|
- spec/logstash/patches_spec.rb
|
@@ -653,6 +670,7 @@ test_files:
|
|
653
670
|
- spec/logstash/settings/integer_spec.rb
|
654
671
|
- spec/logstash/settings/numeric_spec.rb
|
655
672
|
- spec/logstash/settings/port_range_spec.rb
|
673
|
+
- spec/logstash/settings/splittable_string_array_spec.rb
|
656
674
|
- spec/logstash/settings/string_spec.rb
|
657
675
|
- spec/logstash/settings/time_value_spec.rb
|
658
676
|
- spec/logstash/settings/writable_directory_spec.rb
|