Filebeat : Badly Stuck with Connection reset by peer error

Your problem looks very similar to my problem (Elasitcsearch-ruby raises "Cannot get new connection from pool" error), but maybe it is now problem in different plugin.

I found my error by finding the exact place in the code where my exception was thrown (I would suggest to do the same). Next I modified the code to retrieve additional information about the connection (url, parameters, used libraries etc.). I compiled the code and deployed on the server. I repeated these steps few time until I found the reasons . In my case I found the code which depends on the API call which is not supported by AWS in the same way as Elasticsearch.

It is a little bit primitive way of doing it, but only in such a way I was able to trace the root cause of the problem. Fortunately all my code was open sourced.