From b82d75ce2c9c89eeefd4b9d7a5dcaed61151ef47 Mon Sep 17 00:00:00 2001 From: Rob Bavey Date: Wed, 19 Dec 2018 13:08:18 -0500 Subject: [PATCH] Add explicit default, tidy docs and set property correctly Initial PR was calling '.value' on configuration property which does not exist for a string type Fixes #213 --- docs/index.asciidoc | 18 +++++++++--------- lib/logstash/outputs/kafka.rb | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/index.asciidoc b/docs/index.asciidoc index 638eb71..43ab04a 100644 --- a/docs/index.asciidoc +++ b/docs/index.asciidoc @@ -82,6 +82,7 @@ This plugin supports the following configuration options plus the <> |<>|No | <> |<>, one of `["PLAINTEXT", "SSL", "SASL_PLAINTEXT", "SASL_SSL"]`|No | <> |<>|No +| <> |<>|No | <> |<>|No | <> |a valid filesystem path|No | <> |<>|No @@ -89,7 +90,6 @@ This plugin supports the following configuration options plus the <> |a valid filesystem path|No | <> |<>|No | <> |<>|No -| <> |<>|No | <> |<>|Yes | <> |<>|No |======================================================================= @@ -333,6 +333,14 @@ Security protocol to use, which can be either of PLAINTEXT,SSL,SASL_PLAINTEXT,SA The size of the TCP send buffer to use when sending data. +[id="plugins-{type}s-{plugin}-ssl_endpoint_identification_algorithm"] +===== `ssl_endpoint_identification_algorithm` + + * Value type is <> + * Default value is `"https"` + +The endpoint identification algorithm, defaults to "https". Set to empty string "" to disable + [id="plugins-{type}s-{plugin}-ssl_key_password"] ===== `ssl_key_password` @@ -389,14 +397,6 @@ The truststore password The truststore type. -[id="plugins-{type}s-{plugin}-ssl_endpoint_identification_algorithm"] -===== `ssl_endpoint_identification_algorithm` - - * Value type is <> - * Default value is `"https"` - -The endpoint identification algorithm, defaults to "https". Set to empty string "" to disable - [id="plugins-{type}s-{plugin}-topic_id"] ===== `topic_id` diff --git a/lib/logstash/outputs/kafka.rb b/lib/logstash/outputs/kafka.rb index ace2d08..1abda11 100644 --- a/lib/logstash/outputs/kafka.rb +++ b/lib/logstash/outputs/kafka.rb @@ -141,7 +141,7 @@ class LogStash::Outputs::Kafka < LogStash::Outputs::Base # The password of the private key in the key store file. config :ssl_key_password, :validate => :password # Algorithm to use when verifying host. Set to "" to disable - config :ssl_endpoint_identification_algorithm, :validate => :string + config :ssl_endpoint_identification_algorithm, :validate => :string, :default => 'https' # Security protocol to use, which can be either of PLAINTEXT,SSL,SASL_PLAINTEXT,SASL_SSL config :security_protocol, :validate => ["PLAINTEXT", "SSL", "SASL_PLAINTEXT", "SASL_SSL"], :default => "PLAINTEXT" # http://kafka.apache.org/documentation.html#security_sasl[SASL mechanism] used for client connections. @@ -367,7 +367,7 @@ def set_trustore_keystore_config(props) props.put("ssl.key.password", ssl_key_password.value) unless ssl_key_password.nil? props.put("ssl.keystore.location", ssl_keystore_location) unless ssl_keystore_location.nil? props.put("ssl.keystore.password", ssl_keystore_password.value) unless ssl_keystore_password.nil? - props.put("ssl.endpoint.identification.algorithm", ssl_endpoint_identification_algorithm.value) unless ssl_endpoint_identification_algorithm.nil? + props.put("ssl.endpoint.identification.algorithm", ssl_endpoint_identification_algorithm) unless ssl_endpoint_identification_algorithm.nil? end def set_sasl_config(props)