logstash-core 6.0.0.beta2-java → 6.0.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/gemspec_jars.rb +5 -5
- data/lib/logstash-core/logstash-core.jar +0 -0
- data/lib/logstash-core/version.rb +8 -4
- data/lib/logstash-core_jars.rb +10 -10
- data/lib/logstash/agent.rb +3 -2
- data/lib/logstash/compiler/lscl.rb +15 -3
- data/lib/logstash/config/config_ast.rb +3 -2
- data/lib/logstash/config/modules_common.rb +1 -0
- data/lib/logstash/config/source/local.rb +2 -1
- data/lib/logstash/instrument/periodic_poller/dlq.rb +8 -3
- data/lib/logstash/instrument/periodic_poller/pq.rb +7 -3
- data/lib/logstash/logging/logger.rb +4 -1
- data/lib/logstash/modules/kibana_client.rb +35 -8
- data/lib/logstash/modules/logstash_config.rb +1 -1
- data/lib/logstash/modules/settings_merger.rb +8 -2
- data/lib/logstash/pipeline.rb +10 -19
- data/lib/logstash/pipeline_action/stop.rb +1 -0
- data/lib/logstash/runner.rb +4 -1
- data/lib/logstash/util/cloud_setting_id.rb +46 -12
- data/lib/logstash/util/modules_setting_array.rb +1 -1
- data/lib/logstash/util/password.rb +2 -4
- data/lib/logstash/util/wrapped_acked_queue.rb +6 -0
- data/lib/logstash/util/wrapped_synchronous_queue.rb +6 -0
- data/lib/logstash/version.rb +8 -10
- data/logstash-core.gemspec +25 -3
- data/spec/logstash/agent/converge_spec.rb +23 -10
- data/spec/logstash/agent_spec.rb +35 -15
- data/spec/logstash/api/modules/node_stats_spec.rb +5 -1
- data/spec/logstash/compiler/compiler_spec.rb +29 -0
- data/spec/logstash/config/source/local_spec.rb +3 -2
- data/spec/logstash/event_spec.rb +57 -0
- data/spec/logstash/modules/kibana_client_spec.rb +60 -0
- data/spec/logstash/modules/logstash_config_spec.rb +7 -1
- data/spec/logstash/modules/scaffold_spec.rb +1 -1
- data/spec/logstash/modules/settings_merger_spec.rb +32 -2
- data/spec/logstash/pipeline_action/create_spec.rb +4 -1
- data/spec/logstash/pipeline_action/reload_spec.rb +4 -1
- data/spec/logstash/pipeline_dlq_commit_spec.rb +3 -1
- data/spec/logstash/pipeline_pq_file_spec.rb +5 -7
- data/spec/logstash/pipeline_spec.rb +26 -38
- data/spec/logstash/runner_spec.rb +1 -5
- data/spec/logstash/settings/modules_spec.rb +13 -2
- data/spec/logstash/settings/writable_directory_spec.rb +13 -10
- data/spec/logstash/timestamp_spec.rb +2 -2
- data/spec/logstash/util/cloud_setting_id_spec.rb +93 -0
- data/spec/support/helpers.rb +1 -1
- data/spec/support/mocks_classes.rb +14 -0
- data/spec/support/shared_contexts.rb +9 -0
- data/versions-gem-copy.yml +23 -0
- metadata +19 -14
@@ -13,10 +13,10 @@ describe LogStash::Timestamp do
|
|
13
13
|
# we may need to use `be_within(0.000999999).of()` in other places too
|
14
14
|
it "should work" do
|
15
15
|
t = LogStash::Timestamp.new
|
16
|
-
expect(t.time.to_i).to be_within(
|
16
|
+
expect(t.time.to_i).to be_within(2).of Time.now.to_i
|
17
17
|
|
18
18
|
t = LogStash::Timestamp.now
|
19
|
-
expect(t.time.to_i).to be_within(
|
19
|
+
expect(t.time.to_i).to be_within(2).of Time.now.to_i
|
20
20
|
|
21
21
|
now = DateTime.now.to_time.utc
|
22
22
|
t = LogStash::Timestamp.new(now)
|
@@ -0,0 +1,93 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "spec_helper"
|
3
|
+
require "logstash/util/cloud_setting_id"
|
4
|
+
|
5
|
+
describe LogStash::Util::CloudSettingId do
|
6
|
+
let(:input) { "foobar:dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRub3RhcmVhbCRpZGVudGlmaWVy" }
|
7
|
+
subject { described_class.new(input) }
|
8
|
+
|
9
|
+
describe "when given unacceptable input" do
|
10
|
+
it "a nil input does not raise an exception" do
|
11
|
+
expect{described_class.new(nil)}.not_to raise_exception
|
12
|
+
end
|
13
|
+
it "when given a nil input, the accessors are all nil" do
|
14
|
+
cloud_id = described_class.new(nil)
|
15
|
+
expect(cloud_id.original).to be_nil
|
16
|
+
expect(cloud_id.decoded).to be_nil
|
17
|
+
expect(cloud_id.label).to be_nil
|
18
|
+
expect(cloud_id.elasticsearch_host).to be_nil
|
19
|
+
expect(cloud_id.kibana_host).to be_nil
|
20
|
+
expect(cloud_id.elasticsearch_scheme).to be_nil
|
21
|
+
expect(cloud_id.kibana_scheme).to be_nil
|
22
|
+
end
|
23
|
+
|
24
|
+
context "when a malformed value is given" do
|
25
|
+
let(:raw) {%w(first second)}
|
26
|
+
let(:input) { described_class.cloud_id_encode(*raw) }
|
27
|
+
it "raises an error" do
|
28
|
+
expect{subject}.to raise_exception(ArgumentError, "Cloud Id does not decode. You may need to enable Kibana in the Cloud UI. Received: \"#{raw[0]}$#{raw[1]}\".")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context "when at least one segment is empty" do
|
33
|
+
let(:raw) {["first", "", "third"]}
|
34
|
+
let(:input) { described_class.cloud_id_encode(*raw) }
|
35
|
+
it "raises an error" do
|
36
|
+
expect{subject}.to raise_exception(ArgumentError, "Cloud Id, after decoding, is invalid. Format: '<segment1>$<segment2>$<segment3>'. Received: \"#{raw[0]}$#{raw[1]}$#{raw[2]}\".")
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
context "when elasticsearch segment is undefined" do
|
41
|
+
let(:raw) {%w(us-east-1.aws.found.io undefined my-kibana)}
|
42
|
+
let(:input) { described_class.cloud_id_encode(*raw) }
|
43
|
+
it "raises an error" do
|
44
|
+
expect{subject}.to raise_exception(ArgumentError, "Cloud Id, after decoding, elasticsearch segment is 'undefined', literally.")
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
context "when kibana segment is undefined" do
|
49
|
+
let(:raw) {%w(us-east-1.aws.found.io my-elastic-cluster undefined)}
|
50
|
+
let(:input) { described_class.cloud_id_encode(*raw) }
|
51
|
+
it "raises an error" do
|
52
|
+
expect{subject}.to raise_exception(ArgumentError, "Cloud Id, after decoding, the kibana segment is 'undefined', literally. You may need to enable Kibana in the Cloud UI.")
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
describe "without a label" do
|
58
|
+
let(:input) { "dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRub3RhcmVhbCRpZGVudGlmaWVy" }
|
59
|
+
it "#label is empty" do
|
60
|
+
expect(subject.label).to be_empty
|
61
|
+
end
|
62
|
+
it "#decode is set" do
|
63
|
+
expect(subject.decoded).to eq("us-east-1.aws.found.io$notareal$identifier")
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
describe "when given acceptable input, the accessors:" do
|
68
|
+
it '#original has a value' do
|
69
|
+
expect(subject.original).to eq(input)
|
70
|
+
end
|
71
|
+
it '#decoded has a value' do
|
72
|
+
expect(subject.decoded).to eq("us-east-1.aws.found.io$notareal$identifier")
|
73
|
+
end
|
74
|
+
it '#label has a value' do
|
75
|
+
expect(subject.label).to eq("foobar")
|
76
|
+
end
|
77
|
+
it '#elasticsearch_host has a value' do
|
78
|
+
expect(subject.elasticsearch_host).to eq("notareal.us-east-1.aws.found.io:443")
|
79
|
+
end
|
80
|
+
it '#elasticsearch_scheme has a value' do
|
81
|
+
expect(subject.elasticsearch_scheme).to eq("https")
|
82
|
+
end
|
83
|
+
it '#kibana_host has a value' do
|
84
|
+
expect(subject.kibana_host).to eq("identifier.us-east-1.aws.found.io:443")
|
85
|
+
end
|
86
|
+
it '#kibana_scheme has a value' do
|
87
|
+
expect(subject.kibana_scheme).to eq("https")
|
88
|
+
end
|
89
|
+
it '#to_s has a value of #decoded' do
|
90
|
+
expect(subject.to_s).to eq(subject.decoded)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
data/spec/support/helpers.rb
CHANGED
@@ -14,6 +14,20 @@ module LogStash
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
17
|
+
|
18
|
+
module Filters
|
19
|
+
class DummyFilter < LogStash::Filters::Base
|
20
|
+
config_name "dummyfilter"
|
21
|
+
|
22
|
+
def register
|
23
|
+
end
|
24
|
+
|
25
|
+
def filter(event)
|
26
|
+
# noop
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
17
31
|
module Outputs
|
18
32
|
class DummyOutput < LogStash::Outputs::Base
|
19
33
|
config_name "dummyoutput"
|
@@ -21,12 +21,21 @@ shared_context "api setup" do
|
|
21
21
|
settings = mock_settings
|
22
22
|
config_string = "input { generator {id => 'api-generator-pipeline' count => 100 } } output { dummyoutput {} }"
|
23
23
|
settings.set("config.string", config_string)
|
24
|
+
settings.set("config.reload.automatic", false)
|
24
25
|
@agent = make_test_agent(settings)
|
25
26
|
@agent.execute
|
27
|
+
pipeline_config = mock_pipeline_config(:main, "input { generator { id => '123' } } output { null {} }")
|
28
|
+
pipeline_creator = LogStash::PipelineAction::Create.new(pipeline_config, @agent.metric)
|
29
|
+
@pipelines = Hash.new
|
30
|
+
expect(pipeline_creator.execute(@agent, @pipelines)).to be_truthy
|
26
31
|
end
|
27
32
|
|
28
33
|
after :all do
|
29
34
|
@agent.shutdown
|
35
|
+
@pipelines.each do |_, pipeline|
|
36
|
+
pipeline.shutdown
|
37
|
+
pipeline.thread.join
|
38
|
+
end
|
30
39
|
end
|
31
40
|
|
32
41
|
include Rack::Test::Methods
|
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
logstash: 6.0.0
|
3
|
+
logstash-core: 6.0.0
|
4
|
+
logstash-core-plugin-api: 2.1.16
|
5
|
+
jruby:
|
6
|
+
version: 9.1.13.0
|
7
|
+
sha1: 815bac27d5daa1459a4477d6d80584f007ce6a68
|
8
|
+
|
9
|
+
# jruby-runtime-override, if specified, will override the jruby version installed in vendor/jruby for logstash runtime only,
|
10
|
+
# not for the compile-time jars
|
11
|
+
#
|
12
|
+
#jruby-runtime-override:
|
13
|
+
# url: http://ci.jruby.org/snapshots/previous/jruby-bin-9.1.13.0-SNAPSHOT.tar.gz
|
14
|
+
# version: 9.1.13.0-SNAPSHOT
|
15
|
+
# sha1: IGNORE
|
16
|
+
|
17
|
+
# Note: this file is copied to the root of logstash-core because its gemspec needs it when
|
18
|
+
# bundler evaluates the gemspec via bin/logstash
|
19
|
+
# Ensure Jackson version here is kept in sync with version used by jrjackson gem
|
20
|
+
jrjackson: 0.4.4
|
21
|
+
jackson: 2.9.1
|
22
|
+
|
23
|
+
# This is a copy the project level versions.yml into this gem's root and it is created when the gemspec is evaluated.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.0
|
4
|
+
version: 6.0.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -151,7 +151,7 @@ dependencies:
|
|
151
151
|
- !ruby/object:Gem::Dependency
|
152
152
|
requirement: !ruby/object:Gem::Requirement
|
153
153
|
requirements:
|
154
|
-
- -
|
154
|
+
- - ">="
|
155
155
|
- !ruby/object:Gem::Version
|
156
156
|
version: 0.9.20
|
157
157
|
name: jruby-openssl
|
@@ -159,7 +159,7 @@ dependencies:
|
|
159
159
|
type: :runtime
|
160
160
|
version_requirements: !ruby/object:Gem::Requirement
|
161
161
|
requirements:
|
162
|
-
- -
|
162
|
+
- - ">="
|
163
163
|
- !ruby/object:Gem::Version
|
164
164
|
version: 0.9.20
|
165
165
|
- !ruby/object:Gem::Dependency
|
@@ -251,7 +251,7 @@ dependencies:
|
|
251
251
|
requirements:
|
252
252
|
- - "~>"
|
253
253
|
- !ruby/object:Gem::Version
|
254
|
-
version: 0.4.
|
254
|
+
version: 0.4.4
|
255
255
|
name: jrjackson
|
256
256
|
prerelease: false
|
257
257
|
type: :runtime
|
@@ -259,7 +259,7 @@ dependencies:
|
|
259
259
|
requirements:
|
260
260
|
- - "~>"
|
261
261
|
- !ruby/object:Gem::Version
|
262
|
-
version: 0.4.
|
262
|
+
version: 0.4.4
|
263
263
|
- !ruby/object:Gem::Dependency
|
264
264
|
requirement: !ruby/object:Gem::Requirement
|
265
265
|
requirements:
|
@@ -556,6 +556,7 @@ files:
|
|
556
556
|
- spec/logstash/legacy_ruby_event_spec.rb
|
557
557
|
- spec/logstash/legacy_ruby_timestamp_spec.rb
|
558
558
|
- spec/logstash/modules/cli_parser_spec.rb
|
559
|
+
- spec/logstash/modules/kibana_client_spec.rb
|
559
560
|
- spec/logstash/modules/logstash_config_spec.rb
|
560
561
|
- spec/logstash/modules/scaffold_spec.rb
|
561
562
|
- spec/logstash/modules/settings_merger_spec.rb
|
@@ -593,6 +594,7 @@ files:
|
|
593
594
|
- spec/logstash/util/buftok_spec.rb
|
594
595
|
- spec/logstash/util/byte_value_spec.rb
|
595
596
|
- spec/logstash/util/charset_spec.rb
|
597
|
+
- spec/logstash/util/cloud_setting_id_spec.rb
|
596
598
|
- spec/logstash/util/duration_formatter_spec.rb
|
597
599
|
- spec/logstash/util/java_version_spec.rb
|
598
600
|
- spec/logstash/util/plugin_version_spec.rb
|
@@ -609,6 +611,7 @@ files:
|
|
609
611
|
- spec/support/mocks_classes.rb
|
610
612
|
- spec/support/shared_contexts.rb
|
611
613
|
- spec/support/shared_examples.rb
|
614
|
+
- versions-gem-copy.yml
|
612
615
|
homepage: http://www.elastic.co/guide/en/logstash/current/index.html
|
613
616
|
licenses:
|
614
617
|
- Apache License (2.0)
|
@@ -624,20 +627,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
624
627
|
version: '0'
|
625
628
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
626
629
|
requirements:
|
627
|
-
- - "
|
630
|
+
- - ">="
|
628
631
|
- !ruby/object:Gem::Version
|
629
|
-
version:
|
632
|
+
version: '0'
|
630
633
|
requirements:
|
631
634
|
- jar org.apache.logging.log4j:log4j-slf4j-impl, 2.6.2
|
632
635
|
- jar org.apache.logging.log4j:log4j-api, 2.6.2
|
633
636
|
- jar org.apache.logging.log4j:log4j-core, 2.6.2
|
634
|
-
- jar com.fasterxml.jackson.core:jackson-core, 2.
|
635
|
-
- jar com.fasterxml.jackson.core:jackson-databind, 2.
|
636
|
-
- jar com.fasterxml.jackson.core:jackson-annotations, 2.
|
637
|
-
- jar com.fasterxml.jackson.module:jackson-module-afterburner, 2.
|
638
|
-
- jar com.fasterxml.jackson.dataformat:jackson-dataformat-cbor, 2.
|
637
|
+
- jar com.fasterxml.jackson.core:jackson-core, 2.9.1
|
638
|
+
- jar com.fasterxml.jackson.core:jackson-databind, 2.9.1
|
639
|
+
- jar com.fasterxml.jackson.core:jackson-annotations, 2.9.1
|
640
|
+
- jar com.fasterxml.jackson.module:jackson-module-afterburner, 2.9.1
|
641
|
+
- jar com.fasterxml.jackson.dataformat:jackson-dataformat-cbor, 2.9.1
|
639
642
|
rubyforge_project:
|
640
|
-
rubygems_version: 2.6.
|
643
|
+
rubygems_version: 2.6.13
|
641
644
|
signing_key:
|
642
645
|
specification_version: 4
|
643
646
|
summary: logstash-core - The core components of logstash
|
@@ -695,6 +698,7 @@ test_files:
|
|
695
698
|
- spec/logstash/legacy_ruby_event_spec.rb
|
696
699
|
- spec/logstash/legacy_ruby_timestamp_spec.rb
|
697
700
|
- spec/logstash/modules/cli_parser_spec.rb
|
701
|
+
- spec/logstash/modules/kibana_client_spec.rb
|
698
702
|
- spec/logstash/modules/logstash_config_spec.rb
|
699
703
|
- spec/logstash/modules/scaffold_spec.rb
|
700
704
|
- spec/logstash/modules/settings_merger_spec.rb
|
@@ -732,6 +736,7 @@ test_files:
|
|
732
736
|
- spec/logstash/util/buftok_spec.rb
|
733
737
|
- spec/logstash/util/byte_value_spec.rb
|
734
738
|
- spec/logstash/util/charset_spec.rb
|
739
|
+
- spec/logstash/util/cloud_setting_id_spec.rb
|
735
740
|
- spec/logstash/util/duration_formatter_spec.rb
|
736
741
|
- spec/logstash/util/java_version_spec.rb
|
737
742
|
- spec/logstash/util/plugin_version_spec.rb
|