# Error when connecting filebeat to logstash

**URL:** <https://discuss.elastic.co/t/error-when-connecting-filebeat-to-logstash/46099>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 1, 2016, 8:25pm UTC](https://discuss.elastic.co/t/error-when-connecting-filebeat-to-logstash/46099 "2016-04-01T20:25:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aschwanb](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@aschwanb](https://discuss.elastic.co/u/aschwanb)\
**Post date:** [April 1, 2016, 8:25pm UTC](https://discuss.elastic.co/t/error-when-connecting-filebeat-to-logstash/46099/1 "2016-04-01T20:25:45Z")

</div>

Hello everyone

I have a [docker container with logstash](https://hub.docker.com/_/logstash/) running behind an nginx proxy on ubuntu 15 and would like to send information via filebeat from an OS X 10.11 client to logstash.

I can connect to logstash using telnet but filebeat is giving me the following error:  
`single.go:76: INFO Error publishing events (retrying): lumberjack protocol error`

These are my configurations:

filebeat.yml  
`output: logstash: hosts: - my.logstashserver:443 timeout: 15`

logstash.conf  
`input { beats { host => "0.0.0.0" port => 5044 } }`

nginx  
` server {  
listen 443 ssl;  
server\_name my.logstashserve;

```
ssl on;
ssl_certificate mycert;
ssl_certificate_key mykey;

 location / {
     proxy_pass http://logstash.local/;
 }

```

}`

What am I missing?

---

<div class="post-metadata">

**Author:** ![billmurrin](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@billmurrin](https://discuss.elastic.co/u/billmurrin)\
**Post date:** [April 2, 2016, 1:21am UTC](https://discuss.elastic.co/t/error-when-connecting-filebeat-to-logstash/46099/2 "2016-04-02T01:21:15Z")

</div>

> [@aschwanb](#):
>
> logstashserver:443

Where are you defining that nginx should pass the logs to port 5044, I read your configuration to mean it would pass it to port 80 (http). Might need to try

```auto
proxy_pass http://logstash.local:5044;
```

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [April 4, 2016, 11:37am UTC](https://discuss.elastic.co/t/error-when-connecting-filebeat-to-logstash/46099/3 "2016-04-04T11:37:34Z")

</div>

beats protocol is not based on HTTP or compatible to HTTP. If you need a proxy, you will require a TCP-based proxy, as beats-\>logstash is long lived connection. You need ssl/tls support, configure TLS in logstash and filebeat.

---

<div class="post-metadata">

**Author:** ![aschwanb](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@aschwanb](https://discuss.elastic.co/u/aschwanb)\
**Post date:** [April 4, 2016, 12:12pm UTC](https://discuss.elastic.co/t/error-when-connecting-filebeat-to-logstash/46099/4 "2016-04-04T12:12:10Z")

</div>

Thank you both very much for your reply. I forgot to copy my entire nginx configuration into my question. I do actually redirect to the correct port.

But after coming back to the problem I realised, that there is no need to proxy logstash this way. I now have port 5044 open and use a secure tls connection -as steffens suggested.

Thanks again for the help.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 9:53pm UTC](https://discuss.elastic.co/t/error-when-connecting-filebeat-to-logstash/46099/5 "2017-07-05T21:53:52Z")

</div>


