logstash-core 6.4.0-java → 6.4.1-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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75e766866b8e8de1c59212aab21120296be4a2b3768e736e9fc7fae7851d6687
4
- data.tar.gz: 6c9f88892074eaa5c909df9365f94e58e5ec6781c559268b72fdc3c47f59be57
3
+ metadata.gz: 8145b2303fc0c15e198142a1201d06e4462fed9cf1d32b0048c931007e139fe3
4
+ data.tar.gz: 60f764737970347eea41598ff33a2829af597f4a6b2b5efe2597d9b60272a95d
5
5
  SHA512:
6
- metadata.gz: 3dc2bdc1806597be02fd49c75f7c2060543b5decbbb6c5657d680798d2092cabce49044fe8d08490a0ee37f507f4ff5bed5c71b21e72790a81b99e143a58c52d
7
- data.tar.gz: 482cbc47fc99ff43101b28bf0f6fff6488fe1faeeea717a1934afd8dde672d4efd523a7f56749bc4f3822628029ac39b525f66e9d0a6c1207e7cc5292793effb
6
+ metadata.gz: 430c9647d501ce1f1afa84b86f0cb81a8159627a026427c7eb9783f3474cd26a1cab8dcc52cd6da048c42f8e16b63cbdc24cff7dbd98dd94fc5898fa32952add
7
+ data.tar.gz: f67eb745c785e6d8fe2ae666602c754222100ada5e4408f39bd03af4665a1b64f6a1e5cc178919d673289fe4c2fa366cc76aebeb6da711c617083822d1324eb0
@@ -1,6 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require "elasticsearch"
3
3
  require "elasticsearch/transport/transport/http/manticore"
4
+ require 'logstash/util/manticore_ssl_config_helper'
4
5
 
5
6
  module LogStash class ElasticsearchClient
6
7
  include LogStash::Util::Loggable
@@ -20,21 +21,14 @@ module LogStash class ElasticsearchClient
20
21
  end
21
22
 
22
23
  class RubyClient
24
+ include LogStash::Util::ManticoreSSLConfigHelper
25
+
23
26
  def initialize(settings, logger)
24
27
  @settings = settings
25
28
  @logger = logger
26
29
  @client_args = client_args
27
30
 
28
- ssl_options = {}
29
-
30
- # boolean settings may be strings if set through the cli
31
- # or booleans if set through the yaml file, so we use .to_s
32
- if @settings["var.elasticsearch.ssl.enabled"].to_s == "true"
33
- ssl_options[:verify] = @settings.fetch("var.elasticsearch.ssl.verification_mode", true)
34
- ssl_options[:ca_file] = @settings.fetch("var.elasticsearch.ssl.certificate_authority", nil)
35
- ssl_options[:client_cert] = @settings.fetch("var.elasticsearch.ssl.certificate", nil)
36
- ssl_options[:client_key] = @settings.fetch("var.elasticsearch.ssl.key", nil)
37
- end
31
+ ssl_options = manticore_ssl_options_from_config('elasticsearch', settings)
38
32
 
39
33
  @client_args[:ssl] = ssl_options
40
34
 
@@ -22,6 +22,8 @@ module LogStash; class JavaPipeline < JavaBasePipeline
22
22
  def initialize(pipeline_config, namespaced_metric = nil, agent = nil)
23
23
  @logger = self.logger
24
24
  super pipeline_config, namespaced_metric, @logger, agent
25
+ open_queue
26
+
25
27
  @worker_threads = []
26
28
 
27
29
  @drain_queue = settings.get_value("queue.drain") || settings.get("queue.type") == "memory"
@@ -218,7 +220,7 @@ module LogStash; class JavaPipeline < JavaBasePipeline
218
220
  lir_execution, filter_queue_client, @events_filtered, @events_consumed,
219
221
  @flushRequested, @flushing, @shutdownRequested, @drain_queue).run
220
222
  end
221
- thread.name="[#{pipeline_id}]>worker#{t}"
223
+ Util.set_thread_name("[#{pipeline_id}]>worker#{t}")
222
224
  @worker_threads << thread
223
225
  end
224
226
 
@@ -1,10 +1,13 @@
1
1
  # encoding: utf-8
2
2
  require "logstash/json"
3
3
  require "manticore"
4
+ require 'logstash/util/manticore_ssl_config_helper'
4
5
 
5
6
  module LogStash module Modules class KibanaClient
6
7
  include LogStash::Util::Loggable
7
8
 
9
+ include LogStash::Util::ManticoreSSLConfigHelper
10
+
8
11
  class Response
9
12
  # to create a custom response with body as an Object (Hash or Array)
10
13
  attr_reader :status, :body, :headers
@@ -37,17 +40,8 @@ module LogStash module Modules class KibanaClient
37
40
  pool_max_per_route: 2
38
41
  }
39
42
 
40
- ssl_options = {}
41
-
42
- # boolean settings may be strings if set through the cli
43
- # or booleans if set through the yaml file, so we use .to_s
44
- ssl_enabled = @settings["var.kibana.ssl.enabled"].to_s == "true"
45
- if ssl_enabled
46
- ssl_options[:verify] = @settings.fetch("var.kibana.ssl.verification_mode", "strict").to_sym
47
- ssl_options[:ca_file] = @settings.fetch("var.kibana.ssl.certificate_authority", nil)
48
- ssl_options[:client_cert] = @settings.fetch("var.kibana.ssl.certificate", nil)
49
- ssl_options[:client_key] = @settings.fetch("var.kibana.ssl.key", nil)
50
- end
43
+ ssl_options = manticore_ssl_options_from_config('kibana', settings)
44
+ ssl_enabled = ssl_options.any?
51
45
 
52
46
  client_options[:ssl] = ssl_options
53
47
 
@@ -88,6 +88,7 @@ module LogStash; class Pipeline < BasePipeline
88
88
 
89
89
  def initialize(pipeline_config, namespaced_metric = nil, agent = nil)
90
90
  super
91
+ open_queue
91
92
 
92
93
  @worker_threads = []
93
94
 
@@ -284,7 +285,7 @@ module LogStash; class Pipeline < BasePipeline
284
285
  thread = Thread.new(batch_size, batch_delay, self) do |_b_size, _b_delay, _pipeline|
285
286
  _pipeline.worker_loop(_b_size, _b_delay)
286
287
  end
287
- thread.name="[#{pipeline_id}]>worker#{t}"
288
+ Util.set_thread_name("[#{pipeline_id}]>worker#{t}")
288
289
  @worker_threads << thread
289
290
  end
290
291
 
@@ -0,0 +1,71 @@
1
+ # encoding: utf-8
2
+
3
+ module LogStash; module Util; module ManticoreSSLConfigHelper
4
+ extend self
5
+
6
+ ##
7
+ # Extract Manticore-style SSL directives from the given configuration.
8
+ #
9
+ # @param namespace [String] a string namespace (e.g., `kibana` in `var.kibana.ssl.*`)
10
+ # @param settings [Hash<String,Object>] a collection of Manticore-friendly SSL directives.
11
+ # if SSL explicitly disabled, an _empty_ hash will be returned.
12
+ #
13
+ # @return [Hash<Symbol,Object>]
14
+ def manticore_ssl_options_from_config(namespace, settings)
15
+ ssl_settings = strip_prefix(settings, "var.#{namespace}.ssl.")
16
+
17
+ # boolean settings may be strings if set through the cli
18
+ # or booleans if set through the yaml file, so we use .to_s
19
+ if ssl_settings.include?('enabled') && !coerce_boolean(ssl_settings['enabled'])
20
+ logger.warn('SSL explicitly disabled; other SSL settings will be ignored') if logger && ssl_settings.size > 1
21
+ return {}
22
+ end
23
+
24
+ {
25
+ :verify => ssl_settings.fetch('verification_mode', :strict).to_sym,
26
+ :ca_file => ssl_settings.fetch('certificate_authority', nil),
27
+ :client_cert => ssl_settings.fetch('certificate', nil),
28
+ :client_key => ssl_settings.fetch('key', nil),
29
+ }
30
+ end
31
+
32
+ private
33
+
34
+ ##
35
+ # Returns the subset of the hash whose keys match the given prefix, with the prefix removed
36
+ #
37
+ # @param hash [Hash<String,Object>]
38
+ # @param prefix [String]
39
+ # @return [Hash<String,Object>]
40
+ def strip_prefix(hash, prefix)
41
+ hash.each_with_object({}) do |(key, value), memo|
42
+ next unless key.start_with?(prefix)
43
+ unprefixed_key = key[prefix.length..-1]
44
+ memo[unprefixed_key] = value
45
+ end
46
+ end
47
+
48
+ ##
49
+ # Coerces the non-nil input to boolean
50
+ #
51
+ # @param value [Boolean,String,Integer]
52
+ # @return [Boolean]
53
+ def coerce_boolean(value)
54
+ case value
55
+ when true, "true", "T", 1 then true
56
+ when false, "false", "F", 0 then false
57
+ else
58
+ fail("Boolean value required, received `#{value}`")
59
+ end
60
+ end
61
+
62
+ ##
63
+ # Adapter to enable logging via the including class' `#logger` method or `@logger` instance variable
64
+ #
65
+ # @return [Logger,nil]
66
+ def logger
67
+ return super if defined?(super)
68
+
69
+ @logger
70
+ end
71
+ end end end
@@ -1,6 +1,6 @@
1
1
  ---
2
- logstash: 6.4.0
3
- logstash-core: 6.4.0
2
+ logstash: 6.4.1
3
+ logstash-core: 6.4.1
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
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.4.0
4
+ version: 6.4.1
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-18 00:00:00.000000000 Z
11
+ date: 2018-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -448,6 +448,7 @@ files:
448
448
  - lib/logstash/util/filetools.rb
449
449
  - lib/logstash/util/java_version.rb
450
450
  - lib/logstash/util/loggable.rb
451
+ - lib/logstash/util/manticore_ssl_config_helper.rb
451
452
  - lib/logstash/util/modules_setting_array.rb
452
453
  - lib/logstash/util/password.rb
453
454
  - lib/logstash/util/plugin_version.rb