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:

output.logstash:
  hosts: ["127.0.0.1:5044"]

My logstash URL has /logstash appending onto it:

  # The Logstash hosts
  hosts: ["10.1.103.92:30090/logstash/"]

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://10.1.103.92:30090/logstash/)): 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:

10.1.103.92:30090/elasticsearch/
10.1.103.92:30090/kibana/
10.1.103.92:30090/logstash/

Elasticsearch supports this with the path option:

output.elasticsearch:
  enabled: true
  # Array of hosts to connect to.
  hosts: ["10.1.103.92:30090"]
  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.