lib/fluent/plugin/out_elasticsearch_dynamic.rb in fluent-plugin-elasticsearch-2.6.0 vs lib/fluent/plugin/out_elasticsearch_dynamic.rb in fluent-plugin-elasticsearch-2.6.1
- old
+ new
@@ -33,12 +33,12 @@
def create_meta_config_map
{'id_key' => '_id', 'parent_key' => '_parent', 'routing_key' => '_routing'}
end
- def client(host)
+ def client(host = nil)
# check here to see if we already have a client connection for the given host
connection_options = get_connection_options(host)
@_es = nil unless is_existing_connection(connection_options[:hosts])
@@ -275,9 +275,10 @@
end
def is_existing_connection(host)
# check if the host provided match the current connection
return false if @_es.nil?
+ return false if @current_config.nil?
return false if host.length != @current_config.length
for i in 0...host.length
if !host[i][:host].eql? @current_config[i][:host] || host[i][:port] != @current_config[i][:port]
return false