# Logstash twitter 2.2.0 input jruby error NoMethodError

**URL:** <https://discuss.elastic.co/t/logstash-twitter-2-2-0-input-jruby-error-nomethoderror/36814>\
**Category:** Logstash\
**Created:** [December 9, 2015, 11:59pm UTC](https://discuss.elastic.co/t/logstash-twitter-2-2-0-input-jruby-error-nomethoderror/36814 "2015-12-09T23:59:06Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mob](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@mob](https://discuss.elastic.co/u/mob)\
**Post date:** [December 9, 2015, 11:59pm UTC](https://discuss.elastic.co/t/logstash-twitter-2-2-0-input-jruby-error-nomethoderror/36814/1 "2015-12-09T23:59:06Z")

</div>

I was able to get my ELK setup to import the samples using the twitter input plugin but when I changed the conf to use my tags, follows I was able to pass the --configtest but logstash.log filled up with these errors

Does it mean my twitter API requests are unauthorized and if so do I need to have them multiple times for each input?

I'm running  
elastic "number" : "2.1.0",  
with the latest logstash plugins (I ran /opt/logstash/bin/plugin --update before I started with the sample tweets)  
Ubuntu 14

**My Logstash config**  
`input { twitter { # add your data consumer_key => "" consumer_secret => "" oauth_token => "" oauth_token_secret => "" tags => ["MUNvLEI","MunVLei"] follows => ["ChampionsCup","skysportsrugby","btsportrugby","rugbytonight"] full_tweet => true type => "Media" } twitter { # add your data consumer_key => " consumer_secret => "" oauth_token => "" oauth_token_secret => "" tags => ["SUAF","16thman"] follows => ["munsterrugby","MRSC16"] full_tweet => true type => "Munster" } twitter { # add your data consumer_key => " consumer_secret => "" oauth_token => "" oauth_token_secret => "" tags => ["Tigersfamily"] follows => ["leicestertigers"] full_tweet => true type => "Leicester" } } output { elasticsearch { hosts => "localhost" index => "twitter_gis" document_type => "tweet_ls" } }`

**Output from Logstash.log**  
`{:timestamp=>"2015-12-09T23:39:33.893000+0000", :message=>"", :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.1.0-java/lib/logstash/pipeline.rb:205:in `inputworker'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.0-java/lib/logstash/pipeline.rb:198:in`start\_input'"], :options=\>nil, :level=\>:warn}`

---

<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:** [December 10, 2015, 12:47am UTC](https://discuss.elastic.co/t/logstash-twitter-2-2-0-input-jruby-error-nomethoderror/36814/2 "2015-12-10T00:47:54Z")

</div>

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

That means your auth details are wrong somewhere. You need to put them against each input section.

---

<div class="post-metadata">

**Author:** ![mob](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@mob](https://discuss.elastic.co/u/mob)\
**Post date:** [December 10, 2015, 9:51am UTC](https://discuss.elastic.co/t/logstash-twitter-2-2-0-input-jruby-error-nomethoderror/36814/3 "2015-12-10T09:51:48Z")

</div>

Is it possible to include the auth details once to avoid copy & paste errors or make the input section cleaner ?

---

<div class="post-metadata">

**Author:** ![mob](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@mob](https://discuss.elastic.co/u/mob)\
**Post date:** [December 10, 2015, 8:04pm UTC](https://discuss.elastic.co/t/logstash-twitter-2-2-0-input-jruby-error-nomethoderror/36814/4 "2015-12-10T20:04:14Z")

</div>

I have the same API values in each of the 3 inputs  
Do I need a different twitter api set for each twitter{} entry in the input part of the config?

---

<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:** [December 11, 2015, 2:12am UTC](https://discuss.elastic.co/t/logstash-twitter-2-2-0-input-jruby-error-nomethoderror/36814/5 "2015-12-11T02:12:42Z")

</div>

You shouldn't, but I don't know for certain.

---

<div class="post-metadata">

**Author:** ![mob](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@mob](https://discuss.elastic.co/u/mob)\
**Post date:** [December 11, 2015, 10:04am UTC](https://discuss.elastic.co/t/logstash-twitter-2-2-0-input-jruby-error-nomethoderror/36814/6 "2015-12-11T10:04:43Z")

</div>

I don't think its a problem with my twitter credentials as when I have `use_samples => true` there are no errors in the log file and my index is populated with tweets but when I remove it, and delete the index I get a rapidly filling log file and my index isn't created

---

<div class="post-metadata">

**Author:** ![aneveu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aneveu/32/6754_2.png) [@aneveu](https://discuss.elastic.co/u/aneveu)\
**Post date:** [December 21, 2015, 5:41pm UTC](https://discuss.elastic.co/t/logstash-twitter-2-2-0-input-jruby-error-nomethoderror/36814/7 "2015-12-21T17:41:03Z")

</div>

Hi all,

I'm facing the same issue and I know for sure it's not coming from my credentials as I'm using them in two other configuration files and it works perfectly.

The only differences with the last one is that I'm using `follows` instead of `keywords` as I want to retrieve the twitter feed from an account and not only from tags.

Here is the input part of my configuration file:  
`input { twitter { consumer_key => "xxx" consumer_secret => "xxx" oauth_token => "xxx" oauth_token_secret => "xxx" follows => ["@elastic"] full_tweet => true } }`

And here is my stacktrace:

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

Perhaps I'm not using the `follows` attribute the right way? I've tried with or without the `@` before the id but it makes no difference.

I've also tried to add `use_samples => true` as mentionned by @mob and it works but indexed tweets are not relevant.

Any help highly appreciated 🙂

---

<div class="post-metadata">

**Author:** ![MikeKemmerer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikekemmerer/32/34385_2.png) [@MikeKemmerer](https://discuss.elastic.co/u/MikeKemmerer)\
**Post date:** [January 15, 2016, 3:54pm UTC](https://discuss.elastic.co/t/logstash-twitter-2-2-0-input-jruby-error-nomethoderror/36814/8 "2016-01-15T15:54:03Z")

</div>

I'm experiencing this issue as well. My time is correct and I've tested and verified my tokens and keys with Twitter's OAuth tool.

I'm using logstash 2.1.1 and logstash-input-twitter-2.2.0

Mike

---

<div class="post-metadata">

**Author:** ![wathmal](https://avatars.discourse-cdn.com/v4/letter/w/4491bb/32.png) [@wathmal](https://discuss.elastic.co/u/wathmal)\
**Post date:** [April 11, 2016, 5:20am UTC](https://discuss.elastic.co/t/logstash-twitter-2-2-0-input-jruby-error-nomethoderror/36814/9 "2016-04-11T05:20:51Z")

</div>

when you are using " **follows**" parameter you need to include **twitter user's ID instead of user name or screen name.**

you can use [this site](http://gettwitterid.com/) to grab relevant twitter id to username or twitter API.

`follows => ["372841707"]`  
will do the fix for you.

---

<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:03am UTC](https://discuss.elastic.co/t/logstash-twitter-2-2-0-input-jruby-error-nomethoderror/36814/10 "2017-07-06T05:03:01Z")

</div>


