Logstash Twitter input error

Hi,

The following logstash config file fails with the error below (credentials were sanitized):

input {
    twitter {
        consumer_key => "99999999999999999999"
        consumer_secret => "99999999999999999999"
        oauth_token => "99999999999999999999"
        oauth_token_secret => "99999999999999999999"
        languages => ["en"]
        keywords => ["hpe"]

    }
}
output {
     file {
       path => "/tmp/shorttweet.log"
     }
}

==============================================

The error message

[WARN ] 2020-05-07 08:30:39.441 [[main]<twitter] twitter - Twitter client error {:message=>"", :exception=>"Twitter::Error::Unauthorized", :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:328:in `inputworker'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:320:in `block in start_input'"], :options=>nil}

======================================

Even though the error message (Twitter::Error::Unauthorized) looks pretty obvious, the exact same config file works in another server running in the same DMZ. So the credentials are valid.

Logstash version is 7.6.1. The hosting OS is CentOS 7.8.

Any suggestion where to investigate?

Thanks

Matafix.

Problem with the date/time synchronisation.

Update the date using:

# ntpdate yourntpserver

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