From b5a6912379019c93466ca8aac2cab2b35537522f Mon Sep 17 00:00:00 2001 From: kares Date: Wed, 11 Aug 2021 10:50:50 +0200 Subject: [PATCH] Fix: do not mutate incoming @hosts i-var resolves #129 --- lib/logstash/filters/elasticsearch/client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/logstash/filters/elasticsearch/client.rb b/lib/logstash/filters/elasticsearch/client.rb index c14f05a..48484e3 100644 --- a/lib/logstash/filters/elasticsearch/client.rb +++ b/lib/logstash/filters/elasticsearch/client.rb @@ -24,7 +24,7 @@ def initialize(logger, hosts, options = {}) logger.warn "Supplied proxy setting (proxy => '') has no effect" if @proxy.eql?('') transport_options[:proxy] = proxy.to_s if proxy && !proxy.eql?('') - hosts.map! {|h| { host: h, scheme: 'https' } } if ssl + hosts = hosts.map { |host| { host: host, scheme: 'https' } } if ssl # set ca_file even if ssl isn't on, since the host can be an https url ssl_options = { ssl: true, ca_file: options[:ca_file] } if options[:ca_file] ssl_options ||= {}