<p>I want to establish connectivity between filebeat running on a linux based VM and logstash running in kubernetes(logstash exposed through ingress). I have specified logstash output in the filebeat.yml file host: ["<a href="https://example.com/logstash" rel="nofollow noreferrer">https://example.com/logstash</a>"]. I have multiple services exposed through ingress and hence I want the logstash also to be exposed through the same ingress resource. The host attached to ingress resource is <a href="https://www.example.com" rel="nofollow noreferrer">https://www.example.com</a>. And I am using the .crt file of the TLS/SSL certificate associated with example.com in the certificate autority key of the filebeat.yml to secure the connection between filebeat and logstash. And in the logstash.yml which is running on kubernetes I have specified the input as TCP type instead of BEATS type.</p>

<p>Logstash service is running of ClusterIP Type and has the following ingress rule </p>

<pre><code>   http:
     paths:
     - backend:
         serviceName: logstash-service
         servicePort: 5044
       path: /logstash
</code></pre>

<p>Now when I run this entire setup the filebeat on the VM gives me error </p>

<pre><code>  output.go:100#011Failed to connect to backoff(async(tcp://https://example.com/logstash)): lookup https on 168.63.129.16:53: no such host
Jul 29 19:35:16 filebeat[75346]: 2019-07-29T19:35:16.954Z#011INFO#011pipeline/output.go:93#011Attempting to reconnect to backoff(async(tcp://https://example.com/logstash)) with 7 reconnect attempt(s)
Jul 29 19:35:16 filebeat[75346]: 2019-07-29T19:35:16.954Z#011DEBUG#011[logstash]#011logstash/async.go:111#011connect
Jul 29 19:35:16 filebeat[75346]: 2019-07-29T19:35:16.957Z#011WARN#011transport/tcp.go:53#011DNS lookup failure "https": lookup https on 168.63.129.16:53: no such host
</code></pre>

<p>Is this setup technically possible and sane? What should be the host what I should specify in filebeat and what should be the logstash input type? Will specifying the tls.crt specified in filebeat help in authenticating with /logstash?</p>

Nitesh Ratnaparkhe
<p>It looks like you want to use a self-signed SSL certificate with a invalid hostname.
There are two ways to make that hostname works in your self managed network:</p>

<ul>
<li>add a IP record in /etc/hosts for the hostname, the hostname <code>https://example.com/logstash</code> will work in your filebeat config.</li>
<li>create the certificate and <a href="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sssd-ldap-domain-ip" rel="nofollow noreferrer">add a SubjectAltName (SAN)</a> of your IP, change your filebeat config, use IP instead of <code>https://example.com/logstash</code> hostname.</li>
</ul>
