# Twitter::Error::Unauthorized

**URL:** <https://discuss.elastic.co/t/twitter-error-unauthorized/42136>\
**Category:** Logstash\
**Created:** [February 18, 2016, 12:05pm UTC](https://discuss.elastic.co/t/twitter-error-unauthorized/42136 "2016-02-18T12:05:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jitendersaini](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jitendersaini](https://discuss.elastic.co/u/jitendersaini)\
**Post date:** [February 18, 2016, 12:05pm UTC](https://discuss.elastic.co/t/twitter-error-unauthorized/42136/1 "2016-02-18T12:05:52Z")

</div>

HI  
I'm new to EKL and trying to learn this. I've installed the logstash-2.2.2 and elasticsearch-2.1.1 in my machine. I'm trying to read the twitters feed as given in the logstash guide but it's throwing the Unauthorized exception. Please follow the configuration in my conf file:  
input {  
twitter {  
consumer\_key =\> "XXXXXXXXXXXXXX"  
consumer\_secret =\> "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"  
follows =\> ["Oracle","Java"]  
full\_tweet =\> true  
oauth\_token =\> "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"  
oauth\_token\_secret =\> "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"  
}  
}  
output {  
elasticsearch {  
hosts =\> ["127.0.0.1:9200"]   
}  
}

The output when starting the logstash is as below:  
Logstash startup completed  
←[33m {:exception=\>Twitter::Error::Unauthorized, :backtrace=\>["C:/EKL/logstash-2  
.2.2/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:i n`\<\<'", "C:/EKL/logstash-2.2.2/vendor/bundle/jruby/1.9/gems/twitter-5.15.0/lib/  
twitter/streaming/response.rb:16:in `<<'", "C:/EKL/logstash-2.2.2/vendor/bundle/ jruby/1.9/gems/logstash-input-twitter-2.2.0/lib/logstash/inputs/twitter/patches. rb:31:in`stream'", "C:/EKL/logstash-2.2.2/vendor/bundle/jruby/1.9/gems/logstash  
-input-twitter-2.2.0/lib/logstash/inputs/twitter/patches.rb:58:in `request'", "C :/EKL/logstash-2.2.2/vendor/bundle/jruby/1.9/gems/twitter-5.15.0/lib/twitter/str eaming/client.rb:37:in`filter'", "C:/EKL/logstash-2.2.2/vendor/bundle/jruby/1.9  
/gems/logstash-input-twitter-2.2.0/lib/logstash/inputs/twitter.rb:128:in `run'", "C:/EKL/logstash-2.2.2/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-java/li b/logstash/pipeline.rb:331:in`inputworker'", "C:/EKL/logstash-2.2.2/vendor/bund  
le/jruby/1.9/gems/logstash-core-2.2.2-java/lib/logstash/pipeline.rb:325:in `star  
t\_input'"], :options=\>nil, :level=\>:warn}←[0m

I've tried to read the feeds from a java program same time from the same machine with same access keys and oauth keys and it's working very well and printing all the feeds there. It is clear now there is no firewall or machine issue here. It seems there is some issue or bug and Logstash end.  
Please help to resolve this as it is a show stopper issue for me now.

Thanks  
Jitender

---

<div class="post-metadata">

**Author:** ![jitendersaini](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jitendersaini](https://discuss.elastic.co/u/jitendersaini)\
**Post date:** [February 19, 2016, 4:35pm UTC](https://discuss.elastic.co/t/twitter-error-unauthorized/42136/2 "2016-02-19T16:35:25Z")

</div>

Anybody is there who can help me on this bug?????????

---

<div class="post-metadata">

**Author:** ![bigtoerag](https://avatars.discourse-cdn.com/v4/letter/b/6a8cbe/32.png) [@bigtoerag](https://discuss.elastic.co/u/bigtoerag)\
**Post date:** [March 19, 2016, 1:53am UTC](https://discuss.elastic.co/t/twitter-error-unauthorized/42136/3 "2016-03-19T01:53:38Z")

</div>

I have the same issue after running the plugin for the first hour. It ran initially but then i stopped the process to clear down my index and change the keywords now every time I start it I have the unauthorised issue. The only thing that changed from working to not working was the keywords.

I tried waiting in case it was being throttled due to too many requests, I also regenerated my keys with Twitter to no avail.

{:exception=\>Twitter::Error::Unauthorized, :backtrace=\>["/opt/logstash/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`\<\<'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/twitter-5.15.0/lib/twitter/streaming/response.rb:16:in `<<'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-twitter-2.2.0/lib/logstash/inputs/twitter/patches.rb:31:in`stream'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-twitter-2.2.0/lib/logstash/inputs/twitter/patches.rb:58:in `request'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/twitter-5.15.0/lib/twitter/streaming/client.rb:37:in`filter'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-twitter-2.2.0/lib/logstash/inputs/twitter.rb:128:in `run'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-java/lib/logstash/pipeline.rb:331:in`inputworker'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-java/lib/logstash/pipeline.rb:325:in `start\_input'"], :options=\>nil, :level=\>:warn}

---

<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:06am UTC](https://discuss.elastic.co/t/twitter-error-unauthorized/42136/4 "2017-07-06T05:06:22Z")

</div>


