logstash-core 6.8.5-java → 6.8.10-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/dependency_report.rb +2 -1
- data/lib/logstash/util/lazy_singleton.rb +33 -0
- data/lib/logstash/util/substitution_variables.rb +22 -1
- data/spec/logstash/filters/base_spec.rb +35 -0
- data/spec/logstash/settings_spec.rb +10 -0
- data/versions-gem-copy.yml +5 -5
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9324d59810ed24fab4801a5537f7785554efe5d80c9d8f3c5559f75176ae7908
|
4
|
+
data.tar.gz: fc18c736cb507948d6c2a29895d4668cce9ad87b71bc36a03969f07167532493
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5fc041a953b8917170a63c12d015e7d24816d5cad17e8b46af80557821183c8f4a18d42c6c43563065c97866b6dfcba67f5f53de3ae200c6a1f9faadda9f816
|
7
|
+
data.tar.gz: 6427d03332d0631828236c4b3bff49951fe25a1b79fab1f6321c261b31544d7cba74daa479cd45b0aef21008a8ca87bab1dad0f312dba489d47b6716864e15cc
|
@@ -32,8 +32,9 @@ class LogStash::DependencyReport < Clamp::Command
|
|
32
32
|
command = ["./gradlew", "generateLicenseReport", "-PlicenseReportInputCSV=#{ruby_output_path}", "-PlicenseReportOutputCSV=#{output_path}"]
|
33
33
|
puts "Executing #{command}"
|
34
34
|
system(*command)
|
35
|
+
|
35
36
|
if $?.exitstatus != 0
|
36
|
-
raise "
|
37
|
+
raise "generateLicenseReport failed with exit status #{$?.exitstatus}"
|
37
38
|
end
|
38
39
|
|
39
40
|
nil
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'thread' # Mutex
|
2
|
+
|
3
|
+
# A [LazySingleton] wraps the result of the provided block,
|
4
|
+
# which is guaranteed to be called at-most-once, even if the
|
5
|
+
# block's return value is nil.
|
6
|
+
class ::LogStash::Util::LazySingleton
|
7
|
+
|
8
|
+
def initialize(&block)
|
9
|
+
@mutex = Mutex.new
|
10
|
+
@block = block
|
11
|
+
@instantiated = false
|
12
|
+
end
|
13
|
+
|
14
|
+
def instance
|
15
|
+
unless @instantiated
|
16
|
+
@mutex.synchronize do
|
17
|
+
unless @instantiated
|
18
|
+
@instance = @block.call
|
19
|
+
@instantiated = true
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
return @instance
|
25
|
+
end
|
26
|
+
|
27
|
+
def reset!
|
28
|
+
@mutex.synchronize do
|
29
|
+
@instantiated = false
|
30
|
+
@instance = nil
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -2,12 +2,17 @@
|
|
2
2
|
|
3
3
|
java_import "org.logstash.secret.store.SecretStoreExt"
|
4
4
|
|
5
|
+
require_relative 'lazy_singleton'
|
6
|
+
|
5
7
|
module ::LogStash::Util::SubstitutionVariables
|
6
8
|
|
7
9
|
include LogStash::Util::Loggable
|
8
10
|
|
9
11
|
SUBSTITUTION_PLACEHOLDER_REGEX = /\${(?<name>[a-zA-Z_.][a-zA-Z0-9_.]*)(:(?<default>[^}]*))?}/
|
10
12
|
|
13
|
+
SECRET_STORE = ::LogStash::Util::LazySingleton.new { load_secret_store }
|
14
|
+
private_constant :SECRET_STORE
|
15
|
+
|
11
16
|
# Recursive method to replace substitution variable references in parameters
|
12
17
|
def deep_replace(value)
|
13
18
|
if value.is_a?(Hash)
|
@@ -42,7 +47,7 @@ module ::LogStash::Util::SubstitutionVariables
|
|
42
47
|
logger.debug("Replacing `#{placeholder}` with actual value")
|
43
48
|
|
44
49
|
#check the secret store if it exists
|
45
|
-
secret_store =
|
50
|
+
secret_store = SECRET_STORE.instance
|
46
51
|
replacement = secret_store.nil? ? nil : secret_store.retrieveSecret(SecretStoreExt.getStoreId(name))
|
47
52
|
#check the environment
|
48
53
|
replacement = ENV.fetch(name, default) if replacement.nil?
|
@@ -54,4 +59,20 @@ module ::LogStash::Util::SubstitutionVariables
|
|
54
59
|
end
|
55
60
|
end # def replace_placeholders
|
56
61
|
|
62
|
+
class << self
|
63
|
+
private
|
64
|
+
|
65
|
+
# loads a secret_store from disk if available, or returns nil
|
66
|
+
#
|
67
|
+
# @api private
|
68
|
+
# @return [SecretStoreExt,nil]
|
69
|
+
def load_secret_store
|
70
|
+
SecretStoreExt.getIfExists(LogStash::SETTINGS.get_setting("keystore.file").value, LogStash::SETTINGS.get_setting("keystore.classname").value)
|
71
|
+
end
|
72
|
+
|
73
|
+
# @api test
|
74
|
+
def reset_secret_store
|
75
|
+
SECRET_STORE.reset!
|
76
|
+
end
|
77
|
+
end
|
57
78
|
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 {
|
@@ -158,6 +158,11 @@ describe LogStash::Settings do
|
|
158
158
|
|
159
159
|
before :each do
|
160
160
|
LogStash::SETTINGS.set("keystore.file", File.join(File.dirname(__FILE__), "../../src/test/resources/logstash.keystore.with.default.pass"))
|
161
|
+
LogStash::Util::SubstitutionVariables.send(:reset_secret_store)
|
162
|
+
end
|
163
|
+
|
164
|
+
after(:each) do
|
165
|
+
LogStash::Util::SubstitutionVariables.send(:reset_secret_store)
|
161
166
|
end
|
162
167
|
|
163
168
|
context "placeholders in flat logstash.yml" do
|
@@ -211,6 +216,7 @@ describe LogStash::Settings do
|
|
211
216
|
|
212
217
|
before :each do
|
213
218
|
LogStash::SETTINGS.set("keystore.file", File.join(File.dirname(__FILE__), "../../src/test/resources/logstash.keystore.with.default.pass"))
|
219
|
+
LogStash::Util::SubstitutionVariables.send(:reset_secret_store)
|
214
220
|
end
|
215
221
|
|
216
222
|
before do
|
@@ -225,6 +231,10 @@ describe LogStash::Settings do
|
|
225
231
|
ENV.delete('a')
|
226
232
|
end
|
227
233
|
|
234
|
+
after(:each) do
|
235
|
+
LogStash::Util::SubstitutionVariables.send(:reset_secret_store)
|
236
|
+
end
|
237
|
+
|
228
238
|
subject do
|
229
239
|
settings = described_class.new
|
230
240
|
settings.register(LogStash::Setting::ArrayCoercible.new("host", String, []))
|
data/versions-gem-copy.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
|
-
logstash: 6.8.
|
3
|
-
logstash-core: 6.8.
|
2
|
+
logstash: 6.8.10
|
3
|
+
logstash-core: 6.8.10
|
4
4
|
logstash-core-plugin-api: 2.1.16
|
5
5
|
|
6
6
|
# jruby must reference a *released* version of jruby which can be downloaded from the official download url
|
@@ -20,8 +20,8 @@ jruby:
|
|
20
20
|
# Note: this file is copied to the root of logstash-core because its gemspec needs it when
|
21
21
|
# bundler evaluates the gemspec via bin/logstash
|
22
22
|
# Ensure Jackson version here is kept in sync with version used by jrjackson gem
|
23
|
-
jrjackson: 0.4.
|
24
|
-
jackson: 2.9.
|
25
|
-
jackson-databind: 2.9.
|
23
|
+
jrjackson: 0.4.11
|
24
|
+
jackson: 2.9.10
|
25
|
+
jackson-databind: 2.9.10.1
|
26
26
|
|
27
27
|
# 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.8.
|
4
|
+
version: 6.8.10
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -257,7 +257,7 @@ dependencies:
|
|
257
257
|
requirements:
|
258
258
|
- - '='
|
259
259
|
- !ruby/object:Gem::Version
|
260
|
-
version: 0.4.
|
260
|
+
version: 0.4.11
|
261
261
|
name: jrjackson
|
262
262
|
type: :runtime
|
263
263
|
prerelease: false
|
@@ -265,7 +265,7 @@ dependencies:
|
|
265
265
|
requirements:
|
266
266
|
- - '='
|
267
267
|
- !ruby/object:Gem::Version
|
268
|
-
version: 0.4.
|
268
|
+
version: 0.4.11
|
269
269
|
- !ruby/object:Gem::Dependency
|
270
270
|
requirement: !ruby/object:Gem::Requirement
|
271
271
|
requirements:
|
@@ -455,6 +455,7 @@ files:
|
|
455
455
|
- lib/logstash/util/duration_formatter.rb
|
456
456
|
- lib/logstash/util/filetools.rb
|
457
457
|
- lib/logstash/util/java_version.rb
|
458
|
+
- lib/logstash/util/lazy_singleton.rb
|
458
459
|
- lib/logstash/util/loggable.rb
|
459
460
|
- lib/logstash/util/manticore_ssl_config_helper.rb
|
460
461
|
- lib/logstash/util/modules_setting_array.rb
|