lib/logstash/inputs/elasticsearch.rb in logstash-input-elasticsearch-4.12.1 vs lib/logstash/inputs/elasticsearch.rb in logstash-input-elasticsearch-4.12.2

- old
+ new

@@ -384,16 +384,16 @@ @ssl && @ca_file ? { :ssl => true, :ca_file => @ca_file } : {} end def setup_hosts @hosts = Array(@hosts).map { |host| host.to_s } # potential SafeURI#to_s - if @ssl - @hosts.map do |h| - host, port = h.split(":") - { :host => host, :scheme => 'https', :port => port } + @hosts.map do |h| + if h.start_with?('http:', 'https:') + h + else + host, port = h.split(':') + { host: host, port: port, scheme: (@ssl ? 'https' : 'http') } end - else - @hosts end end def setup_basic_auth(user, password) return {} unless user && password && password.value