# Logstash Error with Twitter COnfig

**URL:** <https://discuss.elastic.co/t/logstash-error-with-twitter-config/26631>\
**Category:** Logstash\
**Created:** [July 31, 2015, 9:47am UTC](https://discuss.elastic.co/t/logstash-error-with-twitter-config/26631 "2015-07-31T09:47:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![perkinsl](https://avatars.discourse-cdn.com/v4/letter/p/eb8c5e/32.png) [@perkinsl](https://discuss.elastic.co/u/perkinsl)\
**Post date:** [July 31, 2015, 9:47am UTC](https://discuss.elastic.co/t/logstash-error-with-twitter-config/26631/1 "2015-07-31T09:47:18Z")

</div>

I've looked everywhere to find an answer to the below error but can only find a firewall issue (so tried outside the firewall) and the time stamp being different between the twitter server and my machine (machine timing set correctly). Can anyone advise what's causing the below authorisation error (I've also checked the twitter app and settings are correct and working).

Logstash startup completed  
←[33m {:exception=\>Twitter::Error::Unauthorized, :backtrace=\>["C:/logstash-1.5.1  
/vendor/bundle/jruby/1.9/gems/twitter-5.12.0/lib/twitter/streaming/response.rb:2  
1:in `on_headers_complete'", "org/ruby_http_parser/RubyHttpParser.java:370:in`\<  
\<'", "C:/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/twitter-5.12.0/lib/twitter/  
streaming/response.rb:16:in `<<'", "C:/logstash-1.5.1/vendor/bundle/jruby/1.9/ge ms/twitter-5.12.0/lib/twitter/streaming/connection.rb:22:in`stream'", "C:/logst  
ash-1.5.1/vendor/bundle/jruby/1.9/gems/twitter-5.12.0/lib/twitter/streaming/clie  
nt.rb:116:in `request'", "C:/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/twitter -5.12.0/lib/twitter/streaming/client.rb:36:in`filter'", "C:/logstash-1.5.1/vend  
or/bundle/jruby/1.9/gems/logstash-input-twitter-0.1.6/lib/logstash/inputs/twitte  
r.rb:88:in `run'", "C:/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/logstash-core -1.5.1-java/lib/logstash/pipeline.rb:176:in`inputworker'", "C:/logstash-1.5.1/v  
endor/bundle/jruby/1.9/gems/logstash-core-1.5.1-java/lib/logstash/pipeline.rb:17  
0:in `start\_input'"], :level=\>:warn}←[0m

I'm using the below twitter config:-

input {  
twitter {  
consumer\_key =\> "xxxxxxxxxxxxxxxxxx"  
consumer\_secret =\> "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"  
oauth\_token =\> "xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"  
oauth\_token\_secret =\> "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"  
keywords =\> ["xxxxxxxxxxx"]  
full\_tweet =\> true  
}  
}

output {  
stdout { codec =\> dots }  
elasticsearch {  
protocol =\> "http"  
host =\> "localhost"  
index =\> "twitter"  
document\_type =\> "tweet"  
template =\> "twitter\_template.json"  
template\_name =\> "twitter"  
}  
}

Thanks

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 1, 2015, 5:15am UTC](https://discuss.elastic.co/t/logstash-error-with-twitter-config/26631/2 "2015-08-01T05:15:10Z")

</div>

> [@perkinsl](#):
>
> Twitter::Error::Unauthorized

Would indicate permissions problems with the auth details you are using.

---

<div class="post-metadata">

**Author:** ![perkinsl](https://avatars.discourse-cdn.com/v4/letter/p/eb8c5e/32.png) [@perkinsl](https://discuss.elastic.co/u/perkinsl)\
**Post date:** [August 4, 2015, 3:30pm UTC](https://discuss.elastic.co/t/logstash-error-with-twitter-config/26631/3 "2015-08-04T15:30:23Z")

</div>

I tried the same from outside the firewall and instead of authorisation issue I get a connection refused. So I believe warkolm you were correct but that's just left me with a different problem.

←[33mConnection refused - Connection refused {:exception=\># Connection refused - Connection refused\>, :backtrace=\>["org/jruby/ext/socket/Ru  
byTCPSocket.java:126:in initialize'", "org/jruby/RubyIO.java:853:innew'", "C:  
/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/twitter-5.12.0/lib/twitter/streamin  
g/connection.rb:16:in stream'", "C:/logstash-1.5.1/vendor/bundle/jruby/1.9/gems  
/twitter-5.12.0/lib/twitter/streaming/client.rb:116:inrequest'", "C:/logstash-  
1.5.1/vendor/bundle/jruby/1.9/gems/twitter-5.12.0/lib/twitter/streaming/client.r  
b:36:in filter'", "C:/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/logstash-inpu  
t-twitter-0.1.6/lib/logstash/inputs/twitter.rb:88:inrun'", "C:/logstash-1.5.1/  
vendor/bundle/jruby/1.9/gems/logstash-core-1.5.1-java/lib/logstash/pipeline.rb:1  
76:in inputworker'", "C:/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/logstash-c  
ore-1.5.1-java/lib/logstash/pipeline.rb:170:instart\_input'"], :level=\>:warn}←[  
0m

This is even after trying a new set of twitter authorization codes.

Any new thoughts?

Thanks  
Leigh

---

<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:** [July 6, 2017, 5:32am UTC](https://discuss.elastic.co/t/logstash-error-with-twitter-config/26631/4 "2017-07-06T05:32:55Z")

</div>


