# Twitter plugin giving errors

**URL:** <https://discuss.elastic.co/t/twitter-plugin-giving-errors/78964>\
**Category:** Logstash\
**Created:** [March 17, 2017, 5:48am UTC](https://discuss.elastic.co/t/twitter-plugin-giving-errors/78964 "2017-03-17T05:48:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaijhala](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaijhala/32/16497_2.png) [@jaijhala](https://discuss.elastic.co/u/jaijhala)\
**Post date:** [March 17, 2017, 5:48am UTC](https://discuss.elastic.co/t/twitter-plugin-giving-errors/78964/1 "2017-03-17T05:48:54Z")

</div>

I'm trying to implement this example in my lab -\> [https://github.com/elastic/examples/tree/master/ElasticStack\_twitter](https://github.com/elastic/examples/tree/master/ElasticStack_twitter)

I'm using version 5.2.1

But when I start logstash I'm seeing below errors -\>

[2017-03-16T22:32:23,330][WARN][logstash.inputs.twitter] Twitter client error {:message=\>"", :exception=\>"Twitter::Error::Unauthorized", :backtrace=\>["/Desktop/elastic/logstash-5.2.1/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`\<\<'", "/Desktop/elastic/logstash-5.2.1/vendor/bundle/jruby/1.9/gems/twitter-5.15.0/lib/twitter/streaming/response.rb:16:in `<<'", "/Desktop/elastic/logstash-5.2.1/vendor/bundle/jruby/1.9/gems/logstash-input-twitter-3.0.3/lib/logstash/inputs/twitter/patches.rb:31:in`stream'", "/Desktop/elastic/logstash-5.2.1/vendor/bundle/jruby/1.9/gems/logstash-input-twitter-3.0.3/lib/logstash/inputs/twitter/patches.rb:58:in `request'" and so on.

After trying to hit ctrl c it gives me this error -\>

[2017-03-16T22:32:27,820][WARN][logstash.inputs.twitter] Twitter client error {:message=\>"undefined method `filter' for nil:NilClass", :exception=>"NoMethodError", :backtrace=>["/Desktop/elastic/logstash-5.2.1/vendor/bundle/jruby/1.9/gems/logstash-input-twitter-3.0.3/lib/logstash/inputs/twitter.rb:138:in`run'", "/Desktop/elastic/logstash-5.2.1/logstash-core/lib/logstash/pipeline.rb:370:in `inputworker'", "/Desktop/elastic/logstash-5.2.1/logstash-core/lib/logstash/pipeline.rb:364:in`start\_input'"], :options=\>nil}

My logstash.conf file -\>

input {  
twitter {  
consumer\_key =\> ""  
consumer\_secret =\> ""  
oauth\_token =\> ""  
oauth\_token\_secret =\> ""  
keywords =\> ["thor", "marvel"]  
full\_tweet =\> true  
#locations =\> "-95.71289100000001,37.09024"  
}  
}

filter { }

output {  
stdout {  
codec =\> dots  
}  
elasticsearch {  
hosts =\> "localhost:9200"  
index =\> "twitter\_elastic\_example"  
document\_type =\> "tweets"  
template =\> "/Desktop/elastic/twitter\_elastic\_example/twitter\_template.json"  
template\_name =\> "twitter\_elastic\_example"  
template\_overwrite =\> true  
}  
}

This is not a proxy issue. The date and time is correct on my machine so that's not an issue too.  
It was working a few days ago with the same version and everything but I just wiped everything, re-installed it and now facing this. Already tried version 5.2.2, no help.  
Tried changing keywords as well.

Further research suggests this link -\> [https://github.com/elastic/logstash/issues/5834](https://github.com/elastic/logstash/issues/5834)  
Am I hitting above bug? Is there any workaround for it?  
It still does not explain why it was working before though.

---

<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:** [March 17, 2017, 5:57am UTC](https://discuss.elastic.co/t/twitter-plugin-giving-errors/78964/2 "2017-03-17T05:57:40Z")

</div>

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

That would suggest your API details are incorrect.

---

<div class="post-metadata">

**Author:** ![jaijhala](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaijhala/32/16497_2.png) [@jaijhala](https://discuss.elastic.co/u/jaijhala)\
**Post date:** [March 20, 2017, 7:59pm UTC](https://discuss.elastic.co/t/twitter-plugin-giving-errors/78964/3 "2017-03-20T19:59:46Z")

</div>

Was indeed a credential issue there. Thanks!

---

<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:** [April 17, 2017, 8:00pm UTC](https://discuss.elastic.co/t/twitter-plugin-giving-errors/78964/4 "2017-04-17T20:00:00Z")

</div>

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