Twitter plugin : Twitter client error {:message=>"", :exception=>"Twitter::Error::BadRequest",

Hi

My version of elasticsearch, logstash is 7.9.1
I am trying to get the twitter input plugin working.

My input config is:
input {
twitter {
consumer_key => "aaaa"
consumer_secret => "bbb"
oauth_token => "ccc"
oauth_token_secret => "ddd"
keywords => [ "elections" ]
full_tweet => true
ignore_retweets => true
proxy_address => "161.89.61.209"
proxy_port => 8080
use_proxy => true
}
}

I get the following messages:

[WARN ] 2020-09-10 09:58:14.952 [[main]<twitter] twitter - Twitter client error {:message=>"", :exception=>"Twitter::Error::BadRequest", :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/twitter-6.2.0/lib/twitter/streaming/response.rb:24:in on_headers_complete'", "org/ruby_http_parser/RubyHttpParser.java:370:in <<'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/twitter-6.2.0/lib/twitter/streaming/response.rb:19:in <<'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/twitter-6.2.0/lib/twitter/streaming/connection.rb:20:in stream'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/twitter-6.2.0/lib/twitter/streaming/client.rb:119:in request'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/twitter-6.2.0/lib/twitter/streaming/client.rb:38:in filter'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-twitter-4.0.1/lib/logstash/inputs/twitter.rb:137:in run'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:378:in inputworker'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:369:in block in start_input'"], :options=>nil}`

And:
[WARN ] 2020-09-10 09:58:15.456 [[main]<twitter] twitter - Twitter client error {:message=>"undefined method filter' for nil:NilClass", :exception=>"NoMethodError", :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-twitter-4.0.1/lib/logstash/inputs/twitter.rb:137:in run'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:378:in inputworker'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:369:in block in start_input'"], :options=>nil}

What am I doing wrong?

I verified my keys that they are working with a python script.

Regards Hans

Hey Hans, did you by any chance try with the proxy disabled?

If the python script works with the same credentials, some proxy interference (changing/dropping a header) might be of an issue - would be worth a quick test to switch use_proxy => false.

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