Skip to content
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

normalise hosts to URI::Generics, which reliably preserve defaults #112

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yaauie
Copy link
Contributor

@yaauie yaauie commented Mar 26, 2019

An upstream bug in the Elasticsearch Ruby Client's handling of String host
arguments that begin with a schema (e.g., https://localhost) causes it to
default to port 80 or 443, depending on the schema, instead of Elasticsearch's
port 9200.

Since the Elasticsearch Ruby Client will accept a URI in this case, and will
correctly handle falling through to appropriate defaults, we normalise to
URI::Generic, which does not have a default port.

We absorb the ssl => true case into this normalisation, as its previous
implementation prevented the use of non-default ports in the array provided
to hosts.

We also add support for IPv6 addresses, requiring a square-bracketed notation
(see: RFC2732)

Supersedes: #104
Resolves: #110
Resolves: #111

spec/filters/elasticsearch_spec.rb Outdated Show resolved Hide resolved
lib/logstash/filters/elasticsearch.rb Show resolved Hide resolved
lib/logstash/filters/elasticsearch.rb Outdated Show resolved Hide resolved
lib/logstash/filters/elasticsearch.rb Outdated Show resolved Hide resolved
An upstream bug in the Elasticsearch Ruby Client's handling of `String` host
arguments that begin with a schema (e.g., `https://localhost`) causes it to
default to port 80 or 443, depending on the schema, instead of Elasticsearch's
port 9200.

Since the Elasticsearch Ruby Client will accept a `URI` in this case, and will
correctly handle falling through to appropriate defaults, we normalise to
`URI::Generic`, which does not have a default port.

We absorb the `ssl => true` case into this normalisation, as its previous
implementation prevented the use of non-default ports in the array provided
to `hosts`.

We also add support for IPv6 addresses, requiring a square-bracketed notation
when used in conjunction with a specified port.
(see: RFC-3986)

Supersedes: logstash-plugins#104
Resolves:   logstash-plugins#110
Resolves:   logstash-plugins#111
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants