Getting Connection Error with Twitter Input in Logstash

Hi All,
I am in China where Twitter is Blocked.
I created my dev app in https://apps.twitter.com and collected all essential Key and tokens.
My Conf file is as below :-

input {
twitter {
consumer_key => 'XXXXX'
consumer_secret => 'XXXXX'
oauth_token => 'XXX-XXXX'
oauth_token_secret => 'XXXX'
keywords => ['Text1']
full_tweet => true
}
}
output {
stdout {
codec => rubydebug
}
}

While running as in localhost mode, I am getting Error.

[2018-04-26T12:06:30,005][WARN ][logstash.inputs.twitter ] Twitter client error {:message=>"Connection refused - connect(2) for "172.16.51.158" port 1080", :exception=>"Errno::ECONNREFUSED", :backtrace=>["org/jruby/ext/socket/RubyTCPSocket.java:134:in initialize'", "org/jruby/RubyIO.java:875:innew'", "C:/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-twitter-3.0.7/lib/logstash/inputs/twitter/patches.rb:26:in stream'", "C:/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-twitter-3.0.7/lib/logstash/inputs/twitter/patches.rb:58:inrequest'", "C:/logstash/vendor/bundle/jruby/2.3.0/gems/twitter-5.15.0/lib/twitter/streaming/client.rb:37:in filter'", "C:/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-twitter-3.0.7/lib/logstash/inputs/twitter.rb:138:inrun'", "C:/logstash/logstash-core/lib/logstash/pipeline.rb:516:in inputworker'", "C:/logstash/logstash-core/lib/logstash/pipeline.rb:509:inblock in start_input'"], :options=>nil}
[2018-04-26T12:06:31,066][WARN ][logstash.inputs.twitter ] Twitter client error {:message=>"Connection refused - connect(2) for "172.16.51.158" port 1080", :exception=>"Errno::ECONNREFUSED", :backtrace=>["org/jruby/ext/socket/RubyTCPSocket.java:134:in initialize'", "org/jruby/RubyIO.java:875:innew'", "C:/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-twitter-3.0.7/lib/logstash/inputs/twitter/patches.rb:26:in stream'", "C:/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-twitter-3.0.7/lib/logstash/inputs/twitter/patches.rb:58:inrequest'", "C:/logstash/vendor/bundle/jruby/2.3.0/gems/twitter-5.15.0/lib/twitter/streaming/client.rb:37:in filter'", "C:/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-twitter-3.0.7/lib/logstash/inputs/twitter.rb:138:inrun'", "C:/logstash/logstash-core/lib/logstash/pipeline.rb:516:in inputworker'", "C:/logstash/logstash-core/lib/logstash/pipeline.rb:509:inblock in start_input'"], :options=>nil}

Please tell me how to resolve this.
I checked other Threads also , but not able to find exact solution.
Thanks.

172.16.51.158:1080 looks like the address of a corporate proxy. Should Logstash be talking to it? If yes, why is it actively rejecting the connections? That's something we can't help you with.

Hi Magnus,
Can you please explain me your meaning of "Should Logstash be talking to particular IP" ?
I installed ELK stack as Single Stand alone and by default keep it as Localhost.

That IP I used as in Twitter Input Parameter configuration.

That IP I used as in Twitter Input Parameter configuration.

172.16.51.158 can't possibly be the IP address of Twitters API servers (see https://en.wikipedia.org/wiki/Private_network), except possibly if you're a Twitter employee. Also, the Twitter servers don't respond to requests on port 1080, but that port is commonly used for proxies. So, I suspect that your twitter input for some reason is attempting to connect to a proxy within your network but that proxy is not responding.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.