I have a pipeline using twitter input:
input {
twitter {
consumer_key => "key"
consumer_secret => "key"
oauth_token => "key"
oauth_token_secret => "key"
keywords => [ "Microsoft"]
full_tweet => true
type => "tweet"
}
}
This pipeline works fine and collect data but an error raise when you add the user mention symbol:
input {
twitter {
consumer_key => "key"
consumer_secret => "key"
oauth_token => "key"
oauth_token_secret => "key"
keywords => [ "@Microsoft"]
full_tweet => true
type => "tweet"
}
}
Which raise the following:
{
:message=>"",
: exception=>"Twitter:: Error::Unauthorized",
:backtrace=> [
"/usr/local/Cellar/logstash/5.5.2/libexec/vendor/bundle/jruby/1.9/gems/twitter-5.15.0/lib/twitter/streaming/response.rb:21:in `on_headers_complete'",
"org/ruby_http_parser/RubyHttpParser.java:370:in `<<'",
"/usr/local/Cellar/logstash/5.5.2/libexec/vendor/bundle/jruby/1.9/gems/twitter-5.15.0/lib/twitter/streaming/response.rb:16:in `<<'",
"/usr/local/Cellar/logstash/5.5.2/libexec/vendor/bundle/jruby/1.9/gems/logstash-input-twitter-3.0.5/lib/logstash/inputs/twitter/patches.rb:31:in `stream'",
"/usr/local/Cellar/logstash/5.5.2/libexec/vendor/bundle/jruby/1.9/gems/logstash-input-twitter-3.0.5/lib/logstash/inputs/twitter/patches.rb:58:in `request'",
"/usr/local/Cellar/logstash/5.5.2/libexec/vendor/bundle/jruby/1.9/gems/twitter-5.15.0/lib/twitter/streaming/client.rb:37:in `filter'",
"/usr/local/Cellar/logstash/5.5.2/libexec/vendor/bundle/jruby/1.9/gems/logstash-input-twitter-3.0.5/lib/logstash/inputs/twitter.rb:138:in `run'",
"/usr/local/Cellar/logstash/5.5.2/libexec/logstash-core/lib/logstash/pipeline.rb:456:in `inputworker'",
"/usr/local/Cellar/logstash/5.5.2/libexec/logstash-core/lib/logstash/pipeline.rb:449:in `start_input'"
],
:options=>nil
}
Then after "ctrl + c" the pipeline the following error is raised:
[2017-09-07T15:30:01,250][WARN ][logstash.inputs.twitter ] Twitter client error
{
: message=>"undefined method `filter' for nil:NilClass",
:exception=>"NoMethodError",
:backtrace=> [
"/usr/local/Cellar/logstash/5.5.2/libexec/vendor/bundle/jruby/1.9/gems/logstash-input-twitter-3.0.5/lib/logstash/inputs/twitter.rb:138:in `run'",
"/usr/local/Cellar/logstash/5.5.2/libexec/logstash-core/lib/logstash/pipeline.rb:456:in `inputworker'",
"/usr/local/Cellar/logstash/5.5.2/libexec/logstash-core/lib/logstash/pipeline.rb:449:in `start_input'"
],
:options=>nil
}
I used tweepy to collect tweet and it's work fine when using user mention? Does this error come from my configuration, Logstash or Twitter?