# Logstash Twitter input error

**URL:** <https://discuss.elastic.co/t/logstash-twitter-input-error/231575>\
**Category:** Logstash\
**Created:** [May 7, 2020, 3:17pm UTC](https://discuss.elastic.co/t/logstash-twitter-input-error/231575 "2020-05-07T15:17:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yann\_Allandit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yann_allandit/32/47234_2.png) [@Yann\_Allandit](https://discuss.elastic.co/u/Yann_Allandit)\
**Post date:** [May 7, 2020, 3:17pm UTC](https://discuss.elastic.co/t/logstash-twitter-input-error/231575/1 "2020-05-07T15:17:02Z")

</div>

Hi,

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

```auto
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

```auto
[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

---

<div class="post-metadata">

**Author:** ![Yann\_Allandit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yann_allandit/32/47234_2.png) [@Yann\_Allandit](https://discuss.elastic.co/u/Yann_Allandit)\
**Post date:** [May 11, 2020, 4:47pm UTC](https://discuss.elastic.co/t/logstash-twitter-input-error/231575/2 "2020-05-11T16:47:02Z")

</div>

Matafix.

Problem with the date/time synchronisation.

Update the date using:

```auto
# ntpdate yourntpserver

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 8, 2020, 4:47pm UTC](https://discuss.elastic.co/t/logstash-twitter-input-error/231575/3 "2020-06-08T16:47:05Z")

</div>

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