Skip to content

Commit 52badf6

Browse files
committed
Be specific with elasticsearch gem to consume up to 9 series. Add comments on the logics to support both elasticsearch and elastic transport gems.
1 parent dfaf929 commit 52badf6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/logstash/inputs/elasticsearch.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,10 @@ def setup_query_executor
641641
end
642642

643643
def get_transport_client_class
644+
# LS-core includes `elasticsearch` gem. The gem is composed of two separate gems: `elasticsearch-api` and `elasticsearch-transport`
645+
# And now `elasticsearch-transport` is old, instead we have `elastic-transport`.
646+
# LS-core updated `elasticsearch` > 8: https://github.com/elastic/logstash/pull/17161
647+
# Following source bits are for the compatibility to support both `elasticsearch-transport` and `elastic-transport` gems
644648
require "elasticsearch/transport/transport/http/manticore"
645649
require_relative "elasticsearch/patches/_elasticsearch_transport_http_manticore"
646650
require_relative "elasticsearch/patches/_elasticsearch_transport_connections_selector"

logstash-input-elasticsearch.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
2626
s.add_runtime_dependency "logstash-mixin-validator_support", '~> 1.0'
2727
s.add_runtime_dependency "logstash-mixin-scheduler", '~> 1.0'
2828

29-
s.add_runtime_dependency 'elasticsearch', '>= 7.17.9'
29+
s.add_runtime_dependency 'elasticsearch', '>= 7.17.9', '< 9'
3030
s.add_runtime_dependency 'logstash-mixin-ca_trusted_fingerprint_support', '~> 1.0'
3131
s.add_runtime_dependency 'logstash-mixin-normalize_config_support', '~>1.0'
3232

0 commit comments

Comments
 (0)