Connecting logstash to remote elasticsearch running on https with no port specified

Hello ,
i am running Elasticsearch on a website called Cloud IDE gitpod. Once i start the docker image on the gitpod,

docker run \
      --name elasticsearch \
      --net elastic \
      -p 9200:9200 \
      -e discovery.type=single-node \
      -e ES_JAVA_OPTS="-Xms1g -Xmx1g"\
      -e \
      -it \

Elasticsearch will start successfully i get a full https public url to access the service.. No PORT will be given in the end:

When i access the url in browser, i am able to see Elasticsearch details :

  "name" : "3f0f5479c2cb",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "5P-U6anjQUuIEqrn6IzRvA",
  "version" : {
    "number" : "8.2.3",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "9905bfb62a3f0b044948376b4f607f70a8a151b4",
    "build_date" : "2022-06-08T22:21:36.455508792Z",
    "build_snapshot" : false,
    "lucene_version" : "9.1.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  "tagline" : "You Know, for Search"

When using logstash, i am not able to connect to

        hosts => ""
        index => "library-mgmt-system-logstasssh-index"
        ecs_compatibility => disabled

It fails with Attempted to resurrect connection to dead ES instance, but got an error {:url=>"", :exception=>LogStash::Outputs::Elasticsearch::HttpClient::Pool::HostUnreachableError, :message=>"Elasticsearch Unreachable: [][Manticore::ConnectTimeout]

Not sure why logstash is looking for

But instead it should just connect to

where Elasticsearch is running. does not resolve on gitpod. As we cannot use ports . It gives directly https url internally port forward will be done.

Try to use hosts=> "https://your-host-name:443 to tell logstash to use the default https port.

Also, you didn't anonymize your hostname and your cluster is exposed to the internet without any kind of authentication, I would recommend that you set the security features and also change your hostname now, if it is possible.

Thanks leandro :slight_smile: It worked fine ..

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.