How to specify subpath to logstash host in filebeat.yml

I am trying to ship logs to logstash from filebeat.

With reference to:

In the filebeat.yml, it says to use this for the host:

  hosts: [""]

My logstash URL has /logstash appending onto it:

  # The Logstash hosts
  hosts: [""]

If I put this in for the host I get the following error:

2021-01-28T13:04:37.534Z ERROR [publisher_pipeline_output] pipeline/output.go:154 Failed to connect to backoff(async(tcp:// dial tcp: lookup tcp/30090/logstash/: Servname not supported for ai_socktype

I think it doesn't like the /logstash part of the url. Is there any way to specify that?

Why would you want to do that?

I don't have a choice, it's the way the url is presented from kubernetes. Traffic is routed into the appropriate service using gloo, which distinguishes the various services based on the path it finds in the url, so if the url contains logstash then it knows to route it to the logstash service. I am not sure if I can change it, it's how the different services are presented for example:

Elasticsearch supports this with the path option:

  enabled: true
  # Array of hosts to connect to.
  hosts: [""]
  path: "/elasticsearch/"

I just thought logstash might have something similar, but it doesn't look like it.

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