-
Notifications
You must be signed in to change notification settings - Fork 85
Adds elastic-transport client support #223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mashhurs
merged 4 commits into
logstash-plugins:main
from
mashhurs:support-elastic-transport-client
Mar 17, 2025
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4cecce6
Adds elastic-transport client support where opens LS-core a way to st…
mashhurs dfaf929
Import manticore to resolve uninitialized Manticore error.
mashhurs 52badf6
Be specific with elasticsearch gem to consume up to 9 series. Add com…
mashhurs be39bd3
Update CHANGELOG.md
mashhurs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,9 +13,7 @@ | |
| require "base64" | ||
|
|
||
| require "elasticsearch" | ||
| require "elasticsearch/transport/transport/http/manticore" | ||
| require_relative "elasticsearch/patches/_elasticsearch_transport_http_manticore" | ||
| require_relative "elasticsearch/patches/_elasticsearch_transport_connections_selector" | ||
| require "manticore" | ||
|
|
||
| # .Compatibility Note | ||
| # [NOTE] | ||
|
|
@@ -316,7 +314,7 @@ def register | |
| @client_options = { | ||
| :hosts => hosts, | ||
| :transport_options => transport_options, | ||
| :transport_class => ::Elasticsearch::Transport::Transport::HTTP::Manticore, | ||
| :transport_class => get_transport_client_class, | ||
| :ssl => ssl_options | ||
| } | ||
|
|
||
|
|
@@ -642,6 +640,20 @@ def setup_query_executor | |
| end | ||
| end | ||
|
|
||
| def get_transport_client_class | ||
| # LS-core includes `elasticsearch` gem. The gem is composed of two separate gems: `elasticsearch-api` and `elasticsearch-transport` | ||
| # And now `elasticsearch-transport` is old, instead we have `elastic-transport`. | ||
| # LS-core updated `elasticsearch` > 8: https://github.com/elastic/logstash/pull/17161 | ||
| # Following source bits are for the compatibility to support both `elasticsearch-transport` and `elastic-transport` gems | ||
| require "elasticsearch/transport/transport/http/manticore" | ||
| require_relative "elasticsearch/patches/_elasticsearch_transport_http_manticore" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. review note:
I have kept them for now but it looks to me we can remove. |
||
| require_relative "elasticsearch/patches/_elasticsearch_transport_connections_selector" | ||
| ::Elasticsearch::Transport::Transport::HTTP::Manticore | ||
| rescue ::LoadError | ||
| require "elastic/transport/transport/http/manticore" | ||
| ::Elastic::Transport::Transport::HTTP::Manticore | ||
| end | ||
|
|
||
| module URIOrEmptyValidator | ||
| ## | ||
| # @override to provide :uri_or_empty validator | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,13 @@ | ||
| Gem::Specification.new do |s| | ||
|
|
||
| s.name = 'logstash-input-elasticsearch' | ||
| s.version = '5.0.1' | ||
| s.version = '5.0.2' | ||
| s.licenses = ['Apache License (2.0)'] | ||
| s.summary = "Reads query results from an Elasticsearch cluster" | ||
| s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program" | ||
| s.authors = ["Elastic"] | ||
| s.email = '[email protected]' | ||
| s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html" | ||
| s.homepage = "https://elastic.co/logstash" | ||
| s.require_paths = ["lib"] | ||
|
|
||
| # Files | ||
|
|
@@ -26,7 +26,7 @@ Gem::Specification.new do |s| | |
| s.add_runtime_dependency "logstash-mixin-validator_support", '~> 1.0' | ||
| s.add_runtime_dependency "logstash-mixin-scheduler", '~> 1.0' | ||
|
|
||
| s.add_runtime_dependency 'elasticsearch', '>= 7.17.9' | ||
| s.add_runtime_dependency 'elasticsearch', '>= 7.17.9', '< 9' | ||
| s.add_runtime_dependency 'logstash-mixin-ca_trusted_fingerprint_support', '~> 1.0' | ||
| s.add_runtime_dependency 'logstash-mixin-normalize_config_support', '~>1.0' | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add a comment here explaining what's happening
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just added.