logstash-core 7.5.0-java → 7.5.1-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/config/pipelines_info.rb +0 -4
- data/lib/logstash/inputs/base.rb +4 -3
- data/lib/logstash/java_pipeline.rb +3 -2
- data/lib/logstash/pipeline.rb +2 -2
- data/lib/logstash/util/cloud_setting_id.rb +3 -1
- data/spec/logstash/filters/base_spec.rb +35 -0
- data/spec/logstash/inputs/base_spec.rb +28 -0
- data/spec/logstash/util/cloud_setting_id_spec.rb +56 -0
- data/versions-gem-copy.yml +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 756c0e499f413c9abe6d5abb1f0525aac99667ee6a04ae1d0fd56d7c60e9a31a
|
4
|
+
data.tar.gz: f132194d43addcbd27e7bd9a7ac851441cd28070af0798e0a6fad9417a3baf25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f337f1b1f0eb5e3d663afeae860db418fec5d261e59d8a6ae3b6baf9865d79e0d3715918c58cf923ac2d9895fbe1e4b1c477a3f522994cd7fa3af994ae3ccda
|
7
|
+
data.tar.gz: 93caa27c18905b0a5073b74d732276ea63c6421c579c973a1f350e415bfe1de3d7901080ba0dd76e60402412c53fb1aa05e8ccea88b7f049bd6798f4952c878c
|
@@ -1,7 +1,3 @@
|
|
1
|
-
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
2
|
-
# or more contributor license agreements. Licensed under the Elastic License;
|
3
|
-
# you may not use this file except in compliance with the Elastic License.
|
4
|
-
#
|
5
1
|
module LogStash; module Config;
|
6
2
|
class PipelinesInfo
|
7
3
|
def self.format_pipelines_info(agent, metric_store, extended_performance_collection)
|
data/lib/logstash/inputs/base.rb
CHANGED
@@ -131,11 +131,12 @@ class LogStash::Inputs::Base < LogStash::Plugin
|
|
131
131
|
require "logstash/codecs/line"
|
132
132
|
require "logstash/codecs/json"
|
133
133
|
require "logstash/codecs/json_lines"
|
134
|
-
|
135
|
-
|
134
|
+
|
135
|
+
case @codec.class.name
|
136
|
+
when "LogStash::Codecs::Plain"
|
136
137
|
@logger.info("Automatically switching from #{@codec.class.config_name} to line codec", :plugin => self.class.config_name)
|
137
138
|
@codec = LogStash::Codecs::Line.new("charset" => @codec.charset)
|
138
|
-
when LogStash::Codecs::JSON
|
139
|
+
when "LogStash::Codecs::JSON"
|
139
140
|
@logger.info("Automatically switching from #{@codec.class.config_name} to json_lines codec", :plugin => self.class.config_name)
|
140
141
|
@codec = LogStash::Codecs::JSONLines.new("charset" => @codec.charset)
|
141
142
|
end
|
@@ -8,10 +8,11 @@ require "logstash/instrument/collector"
|
|
8
8
|
require "logstash/compiler"
|
9
9
|
require "logstash/config/lir_serializer"
|
10
10
|
|
11
|
-
java_import org.apache.logging.log4j.ThreadContext
|
12
|
-
|
13
11
|
module LogStash; class JavaPipeline < JavaBasePipeline
|
14
12
|
include LogStash::Util::Loggable
|
13
|
+
|
14
|
+
java_import org.apache.logging.log4j.ThreadContext
|
15
|
+
|
15
16
|
attr_reader \
|
16
17
|
:worker_threads,
|
17
18
|
:events_consumed,
|
data/lib/logstash/pipeline.rb
CHANGED
@@ -12,11 +12,11 @@ require "logstash/instrument/collector"
|
|
12
12
|
require "logstash/filter_delegator"
|
13
13
|
require "logstash/compiler"
|
14
14
|
|
15
|
-
java_import org.apache.logging.log4j.ThreadContext
|
16
|
-
|
17
15
|
module LogStash; class BasePipeline < AbstractPipeline
|
18
16
|
include LogStash::Util::Loggable
|
19
17
|
|
18
|
+
java_import org.apache.logging.log4j.ThreadContext
|
19
|
+
|
20
20
|
attr_reader :inputs, :filters, :outputs
|
21
21
|
|
22
22
|
def initialize(pipeline_config, namespaced_metric = nil, agent = nil)
|
@@ -57,7 +57,7 @@ module LogStash module Util class CloudSettingId
|
|
57
57
|
|
58
58
|
@elasticsearch_host, @kibana_host, *@other_identifiers = segments
|
59
59
|
@elasticsearch_host, @elasticsearch_port = @elasticsearch_host.split(":")
|
60
|
-
@kibana_host, @kibana_port = @kibana_host.split(":")
|
60
|
+
@kibana_host, @kibana_port = @kibana_host.split(":") if @kibana_host
|
61
61
|
@elasticsearch_port ||= cloud_port
|
62
62
|
@kibana_port ||= cloud_port
|
63
63
|
@other_identifiers ||= []
|
@@ -72,7 +72,9 @@ module LogStash module Util class CloudSettingId
|
|
72
72
|
if @kibana_host == "undefined"
|
73
73
|
raise ArgumentError.new("Cloud Id, after decoding, the kibana segment is 'undefined', literally. You may need to enable Kibana in the Cloud UI.")
|
74
74
|
end
|
75
|
+
|
75
76
|
@kibana_scheme = "https"
|
77
|
+
@kibana_host ||= String.new # non-sense really to have '.my-host:443' but we're mirroring others
|
76
78
|
@kibana_host.concat(cloud_host)
|
77
79
|
@kibana_host.concat(":#{@kibana_port}")
|
78
80
|
end
|
@@ -280,6 +280,41 @@ describe LogStash::Filters::NOOP do
|
|
280
280
|
end
|
281
281
|
end
|
282
282
|
|
283
|
+
describe "remove_field within @metadata" do
|
284
|
+
config <<-CONFIG
|
285
|
+
filter {
|
286
|
+
noop {
|
287
|
+
remove_field => ["[@metadata][f1]", "[@metadata][f2]", "[@metadata][f4][f5]"]
|
288
|
+
}
|
289
|
+
}
|
290
|
+
CONFIG
|
291
|
+
|
292
|
+
sample_one("type" => "noop", "@metadata" => {"f1" => "one", "f2" => { "f3" => "three"}, "f4" => { "f5" => "five", "f6" => "six"}, "f7" => "seven"}) do
|
293
|
+
expect(subject.include?("[@metadata][f1]")).to be_falsey
|
294
|
+
expect(subject.include?("[@metadata][f2]")).to be_falsey
|
295
|
+
expect(subject.include?("[@metadata][f4]")).to be_truthy
|
296
|
+
expect(subject.include?("[@metadata][f4][f5]")).to be_falsey
|
297
|
+
expect(subject.include?("[@metadata][f4][f6]")).to be_truthy
|
298
|
+
expect(subject.include?("[@metadata][f7]")).to be_truthy
|
299
|
+
end
|
300
|
+
end
|
301
|
+
|
302
|
+
describe "remove_field on @metadata" do
|
303
|
+
config <<-CONFIG
|
304
|
+
filter {
|
305
|
+
noop {
|
306
|
+
remove_field => ["[@metadata]"]
|
307
|
+
}
|
308
|
+
}
|
309
|
+
CONFIG
|
310
|
+
|
311
|
+
sample_one("type" => "noop", "@metadata" => {"f1" => "one", "f2" => { "f3" => "three"}}) do
|
312
|
+
expect(subject.include?("[@metadata]")).to be_truthy
|
313
|
+
expect(subject.include?("[@metadata][f1]")).to be_falsey
|
314
|
+
expect(subject.include?("[@metadata][f2]")).to be_falsey
|
315
|
+
end
|
316
|
+
end
|
317
|
+
|
283
318
|
describe "remove_field on array" do
|
284
319
|
config <<-CONFIG
|
285
320
|
filter {
|
@@ -113,4 +113,32 @@ describe "LogStash::Inputs::Base#fix_streaming_codecs" do
|
|
113
113
|
tcp.instance_eval { fix_streaming_codecs }
|
114
114
|
expect(tcp.codec.charset).to eq("CP1252")
|
115
115
|
end
|
116
|
+
|
117
|
+
it "should switch plain codec to line" do
|
118
|
+
require "logstash/inputs/tcp"
|
119
|
+
require "logstash/codecs/plain"
|
120
|
+
require "logstash/codecs/line"
|
121
|
+
|
122
|
+
# it is important to use "codec" => "plain" here and not the LogStash::Codecs::Plain instance so that
|
123
|
+
# the config parsing wrap the codec into the delagator which was causing the codec identification bug
|
124
|
+
# per https://github.com/elastic/logstash/issues/11140
|
125
|
+
tcp = LogStash::Inputs::Tcp.new("codec" => "plain", "port" => 0)
|
126
|
+
tcp.register
|
127
|
+
|
128
|
+
expect(tcp.codec.class.name).to eq("LogStash::Codecs::Line")
|
129
|
+
end
|
130
|
+
|
131
|
+
it "should switch json codec to json_lines" do
|
132
|
+
require "logstash/inputs/tcp"
|
133
|
+
require "logstash/codecs/plain"
|
134
|
+
require "logstash/codecs/line"
|
135
|
+
|
136
|
+
# it is important to use "codec" => "json" here and not the LogStash::Codecs::Plain instance so that
|
137
|
+
# the config parsing wrap the codec into the delagator which was causing the codec identification bug
|
138
|
+
# per https://github.com/elastic/logstash/issues/11140
|
139
|
+
tcp = LogStash::Inputs::Tcp.new("codec" => "json", "port" => 0)
|
140
|
+
tcp.register
|
141
|
+
|
142
|
+
expect(tcp.codec.class.name).to eq("LogStash::Codecs::JSONLines")
|
143
|
+
end
|
116
144
|
end
|
@@ -143,4 +143,60 @@ describe LogStash::Util::CloudSettingId do
|
|
143
143
|
expect(subject.other_identifiers).to eq(["anotherid", "andanother"])
|
144
144
|
end
|
145
145
|
end
|
146
|
+
|
147
|
+
describe "when given acceptable input (with empty kibana uuid), the accessors:" do
|
148
|
+
let(:input) { "a-test:ZWNlLmhvbWUubGFuJHRlc3Qk" } # ece.home.lan$test$
|
149
|
+
|
150
|
+
it '#original has a value' do
|
151
|
+
expect(subject.original).to eq(input)
|
152
|
+
end
|
153
|
+
it '#decoded has a value' do
|
154
|
+
expect(subject.decoded).to eq("ece.home.lan$test$")
|
155
|
+
end
|
156
|
+
it '#label has a value' do
|
157
|
+
expect(subject.label).to eq("a-test")
|
158
|
+
end
|
159
|
+
it '#elasticsearch_host has a value' do
|
160
|
+
expect(subject.elasticsearch_host).to eq("test.ece.home.lan:443")
|
161
|
+
end
|
162
|
+
it '#elasticsearch_scheme has a value' do
|
163
|
+
expect(subject.elasticsearch_scheme).to eq("https")
|
164
|
+
end
|
165
|
+
it '#kibana_host has a value' do
|
166
|
+
# NOTE: kibana part is not relevant -> this is how python/beats(go) code behaves
|
167
|
+
expect(subject.kibana_host).to eq(".ece.home.lan:443")
|
168
|
+
end
|
169
|
+
it '#kibana_scheme has a value' do
|
170
|
+
expect(subject.kibana_scheme).to eq("https")
|
171
|
+
end
|
172
|
+
it '#to_s has a value of #decoded' do
|
173
|
+
expect(subject.to_s).to eq(subject.decoded)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
describe "a lengthy real-world input, the accessors:" do
|
178
|
+
let(:input) do
|
179
|
+
"ZWFzdHVzMi5henVyZS5lbGFzdGljLWNsb3VkLmNvbTo5MjQzJDQwYjM0MzExNmNmYTRlYmNiNzZjMTFlZTIzMjlmOTJkJDQzZDA5MjUyNTAyYzQxODlhMzc2ZmQwY2YyY2QwODQ4"
|
180
|
+
# eastus2.azure.elastic-cloud.com:9243$40b343116cfa4ebcb76c11ee2329f92d$43d09252502c4189a376fd0cf2cd0848
|
181
|
+
end
|
182
|
+
|
183
|
+
it '#original has a value' do
|
184
|
+
expect(subject.original).to eq(input)
|
185
|
+
end
|
186
|
+
it '#decoded has a value' do
|
187
|
+
expect(subject.decoded).to eq("eastus2.azure.elastic-cloud.com:9243$40b343116cfa4ebcb76c11ee2329f92d$43d09252502c4189a376fd0cf2cd0848")
|
188
|
+
end
|
189
|
+
it '#label has a value' do
|
190
|
+
expect(subject.label).to eq("")
|
191
|
+
end
|
192
|
+
it '#elasticsearch_host has a value' do
|
193
|
+
expect(subject.elasticsearch_host).to eq("40b343116cfa4ebcb76c11ee2329f92d.eastus2.azure.elastic-cloud.com:9243")
|
194
|
+
end
|
195
|
+
it '#kibana_host has a value' do
|
196
|
+
expect(subject.kibana_host).to eq("43d09252502c4189a376fd0cf2cd0848.eastus2.azure.elastic-cloud.com:9243")
|
197
|
+
end
|
198
|
+
it '#to_s has a value of #decoded' do
|
199
|
+
expect(subject.to_s).to eq(subject.decoded)
|
200
|
+
end
|
201
|
+
end
|
146
202
|
end
|
data/versions-gem-copy.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
# alpha and beta qualifiers are now added via VERSION_QUALIFIER environment var
|
3
|
-
logstash: 7.5.
|
4
|
-
logstash-core: 7.5.
|
3
|
+
logstash: 7.5.1
|
4
|
+
logstash-core: 7.5.1
|
5
5
|
logstash-core-plugin-api: 2.1.16
|
6
6
|
|
7
7
|
# jruby must reference a *released* version of jruby which can be downloaded from the official download url
|
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: 7.5.
|
4
|
+
version: 7.5.1
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|