lib/logstash/inputs/elasticsearch.rb in logstash-input-elasticsearch-4.3.3 vs lib/logstash/inputs/elasticsearch.rb in logstash-input-elasticsearch-4.4.0

- old
+ new

@@ -2,10 +2,11 @@ require "logstash/inputs/base" require "logstash/namespace" require "logstash/json" require "base64" + # .Compatibility Note # [NOTE] # ================================================================================ # Starting with Elasticsearch 5.3, there's an {ref}modules-http.html[HTTP setting] # called `http.content_type.required`. If this option is set to `true`, and you @@ -147,10 +148,11 @@ config :schedule, :validate => :string def register require "elasticsearch" require "rufus/scheduler" + require "elasticsearch/transport/transport/http/manticore" @options = { :index => @index, :scroll => @scroll, :size => @size @@ -174,15 +176,15 @@ { :host => host, :scheme => 'https', :port => port } end else @hosts end + ssl_options = { :ssl => true, :ca_file => @ca_file } if @ssl && @ca_file + ssl_options ||= {} - if @ssl && @ca_file - transport_options[:ssl] = { :ca_file => @ca_file } - end - - @client = Elasticsearch::Client.new(:hosts => hosts, :transport_options => transport_options) + @client = Elasticsearch::Client.new(:hosts => hosts, :transport_options => transport_options, + :transport_class => ::Elasticsearch::Transport::Transport::HTTP::Manticore, + :ssl => ssl_options) end def run(output_queue) if @schedule