Skip to content

Commit d6e26ea

Browse files
committed
Code review changes: define specific elasticsearch gem version range, add comments on the logics to support both elastic and elasticsearch transport gems.
1 parent 244b4e8 commit d6e26ea

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## 4.1.1
2-
- Adds elastic-transport client support [#191](https://github.com/logstash-plugins/logstash-filter-elasticsearch/pull/191)
2+
- Add elastic-transport client support used in elasticsearch-ruby 8.x [#191](https://github.com/logstash-plugins/logstash-filter-elasticsearch/pull/191)
33

44
## 4.1.0
55
- Added support for custom headers [#188](https://github.com/logstash-plugins/logstash-filter-elasticsearch/pull/188)

lib/logstash/filters/elasticsearch/client.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ def setup_api_key(api_key)
100100
end
101101

102102
def get_transport_client_class
103+
# LS-core includes `elasticsearch` gem. The gem is composed of two separate gems: `elasticsearch-api` and `elasticsearch-transport`
104+
# And now `elasticsearch-transport` is old, instead we have `elastic-transport`.
105+
# LS-core updated `elasticsearch` > 8: https://github.com/elastic/logstash/pull/17161
106+
# Following source bits are for the compatibility to support both `elasticsearch-transport` and `elastic-transport` gems
103107
require "elasticsearch/transport/transport/http/manticore"
104108
es_transport_client_type = "elasticsearch_transport"
105109
::Elasticsearch::Transport::Transport::HTTP::Manticore

logstash-filter-elasticsearch.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
2121

2222
# Gem dependencies
2323
s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
24-
s.add_runtime_dependency 'elasticsearch', ">= 7.14.9" # LS >= 6.7 and < 7.14 all used version 5.0.5
24+
s.add_runtime_dependency 'elasticsearch', ">= 7.14.9", '< 9'
2525
s.add_runtime_dependency 'manticore', ">= 0.7.1"
2626
s.add_runtime_dependency 'logstash-mixin-ca_trusted_fingerprint_support', '~> 1.0'
2727
s.add_development_dependency 'cabin', ['~> 0.6']

0 commit comments

Comments
 (0)