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

Plugin uses port 9200 to connect https host while 443 is expected #1078

Open
kaisecheng opened this issue Aug 8, 2022 · 1 comment
Open

Comments

@kaisecheng
Copy link
Contributor

kaisecheng commented Aug 8, 2022

Logstash version 8.3.3

When the hosts point to https url, it is expected to be in port 443 by default, however, the plugin appends 9200.

Steps to reproduce

input {
      heartbeat {
        message => '{"say": "hello"}'
        interval => 1
      }
}
filter {
	json {
		source => "message"
	}
}
output {
    elasticsearch {
      hosts => ["https://YOUR_HOST.europe-west2.gcp.elastic-cloud.com"]
      index => "test_index"
      user => "YOUR_USERNAME"
      password => "YOUR_PASSWORD"
    }
}

Log

[INFO ][logstash.outputs.elasticsearch][main] Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[https://elastic:xxxxxx@YOUR_HOST.europe-west2.gcp.elastic-cloud.com:9200/]}}

Workaround

The workaround is to add :443 to the hosts
hosts => ["https://YOUR_HOST.europe-west2.gcp.elastic-cloud.com:443"]

@yaauie
Copy link
Contributor

yaauie commented Aug 8, 2022

IIRC, this is by design (although the design may need to be re-thought). When you start Elasticsearch on your own, it binds its HTTP API to 9200 unless you explicitly tell it to bind to a different port (whether or not you have TLS enabled, which is also on-by-default in ES 8.x). Out out-of-the-box experience is to match Elasticsearch's default behaviour.

@kaisecheng kaisecheng changed the title it appends 9200 to https hosts while 443 is the expected URL uses 9200 to https host while 443 is expected Jun 4, 2023
@kaisecheng kaisecheng changed the title URL uses 9200 to https host while 443 is expected Plugin uses 9200 to https host while 443 is expected Jun 4, 2023
@kaisecheng kaisecheng changed the title Plugin uses 9200 to https host while 443 is expected Plugin uses port 9200 to connect https host while 443 is expected Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants