Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proxy configuration in pipeline is not effective, needs environment variable instead #40

Open
avallen opened this issue May 21, 2019 · 2 comments

Comments

@avallen
Copy link

avallen commented May 21, 2019

Following the documentation in order to configure a proxy does not work. It says:

This plugin is based on logstash-mixin-http_client thus also supports all HTTP layer parameters like proxy, authentication, timeout etc.

So I configured it like:

sumologic {
    url=>'https://collectors.de.sumologic.com/receiver/v1/http/XYZ=='
    proxy=>'http://proxy.company.net:8888'

This however is not effective, the plugin does not use the configured proxy as indicated by the following error which suggests it tries to resolve the sumologic domain directly instead of connecting the proxy:

[2019-05-21T11:12:07,881][ERROR][logstash.outputs.sumologic] ping failed {:url=>"https://collectors.de.sumologic.com/receiver/v1/http/XYZ==", :message=>"Failed to open TCP connection to collectors.de.sumologic.com:443 (initialize: name or service not known)", :class=>"SocketError", :backtrace=>["org/jruby/ext/socket/RubyTCPSocket.java:137:in `initialize'", "org/jruby/RubyIO.java:115
4:in `open'", "uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http.rb:885:in `block in connect'", "org/jruby/ext/timeout/Timeout.java:149:in `timeout'", "uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http.rb:883:in `connect'", "u
ri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http.rb:868:in `do_start'", "uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http.rb:857:in `start'", "uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http.rb:1409:in `request'
", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-sumologic-1.2.2/lib/logstash/outputs/sumologic/sender.rb:72:in `connect'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-sumologic-1.2.2/lib/logstash/outputs
/sumologic.rb:123:in `register'", "org/logstash/config/ir/compiler/OutputStrategyExt.java:102:in `register'", "org/logstash/config/ir/compiler/AbstractOutputDelegatorExt.java:46:in `register'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline
.rb:242:in `register_plugin'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:253:in `block in register_plugins'", "org/jruby/RubyArray.java:1734:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:253:in `register_pl
ugins'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:594:in `maybe_setup_out_plugins'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:263:in `start_workers'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:2
00:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:160:in `block in start'"]}

What works instead is configuring a proxy in the environment variable http_proxy:

export http_proxy="http://proxy.company.net:8888"
@avallen
Copy link
Author

avallen commented Jun 11, 2019

Just had to configure this again and found that only setting the http_proxy environment variable does not work, it then fails with:

[ERROR][logstash.outputs.sumologic] error in network transmission {:token=>6, :message=>"collectors.de.sumologic.com", :class=>"Manticore::ResolutionFailure", :backtrace=>nil}

So it seems both the plugin parameter and the environment variable are needed.

@xb4r7x
Copy link

xb4r7x commented Aug 19, 2022

Seems to be an issue for my deployment as well, and I cannot for the life of me get it to pass authentication headers, it'll only work unauthenticated.

Were you ever able to make this work any better @avallen ? I know it's been a few years, but figured I'd ask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants