Skip to content

Commit 78d2181

Browse files
liketicjsvd
authored andcommitted
Get maximum version with max() instead
1 parent 0af1cfb commit 78d2181

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/logstash/outputs/elasticsearch/template_manager.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def self.install_template(plugin)
1515
def self.get_es_major_version(client)
1616
# get the elasticsearch version of each node in the pool and
1717
# pick the biggest major version
18-
client.connected_es_versions.uniq.map {|version| version.split(".").first.to_i}.sort.last
18+
client.connected_es_versions.uniq.map {|version| version.split(".").first.to_i}.max
1919
end
2020

2121
def self.get_template(path, es_major_version)

0 commit comments

Comments
 (0)