There are a few options to achieve this but none of them are perfect at this point in time.
SOCKS5 proxy support was added to the logstash output in the recent Beats v5.0.0 ALPHA1 release:
See this pull request to see what the config would look like:
But this is SOCKS5 not HTTP proxy mode, so depends what your proxy is capable of or allows.
Another possibility is to ship events from beats directly to Elasticsearch as the current version of beats has elasticsearch output with a http proxy option:
But this probably won't help you with filebeat as you need logstash to do some transform stuff typically when dealing with log files.
Other than the above options if you can run a logstash on the same side of the proxy as the hosts forwarding logs with beats shippers, then you could use the elasticsearch output in logstash to ship events with HTTP proxy configuration.
Perhaps test out 5.0.0 alpha2 of filebeat which should include the socks5 proxy and see if it works for you.
The 5.0 stable release isn't too far off.
Let me know what you think about the suggested options.