# Twitter client error - undefined method

**URL:** <https://discuss.elastic.co/t/twitter-client-error-undefined-method/184206>\
**Category:** Logstash\
**Created:** [June 4, 2019, 2:18pm UTC](https://discuss.elastic.co/t/twitter-client-error-undefined-method/184206 "2019-06-04T14:18:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mickey\_lubs](https://avatars.discourse-cdn.com/v4/letter/m/d78d45/32.png) [@mickey\_lubs](https://discuss.elastic.co/u/mickey_lubs)\
**Post date:** [June 4, 2019, 2:18pm UTC](https://discuss.elastic.co/t/twitter-client-error-undefined-method/184206/1 "2019-06-04T14:18:17Z")

</div>

Hi,

I have been facing issues using the "locations" parameter in logstash twitter inputs. When i define my longitude and latitude it fails logstash with below error:

This is how i define it:  
locations =\> " -26.195246, 28.034088"

"[WARN][logstash.inputs.twitter] Twitter client error {:message=\>"undefined method `filter' for nil:NilClass", :exception=>"NoMethodError", :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-twitter-3.0.8/lib/logstash/inputs/twitter.rb:138:in`run'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:409:in `inputworker'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:403:in`block in start\_input'"], :options=\>nil}  
[2019-06-04T15:35:16,327][WARN][logstash.inputs.twitter] Twitter client error {:message=\>"undefined method `filter' for nil:NilClass", :exception=>"NoMethodError", :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-twitter-3.0.8/lib/logstash/inputs/twitter.rb:138:in`run'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:409:in `inputworker'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:403:in`block in start\_input'"], :options=\>nil}"

---

<div class="post-metadata">

**Author:** ![pastechecker](https://avatars.discourse-cdn.com/v4/letter/p/0ea827/32.png) [@pastechecker](https://discuss.elastic.co/u/pastechecker)\
**Post date:** [June 4, 2019, 2:26pm UTC](https://discuss.elastic.co/t/twitter-client-error-undefined-method/184206/2 "2019-06-04T14:26:12Z")

</div>

Can you share the whole input configuration you have?  
its little similar to the:

> [@Country/location based data in twitter](https://discuss.elastic.co/t/country-location-based-data-in-twitter/181560):
>
> Hi, i am fetching data from twitter and wants to put a geo-location filter while fetching the data. tried country\_code = ["US","IN"] and location =["us"] but no luck please help. Thanks in advance

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [June 4, 2019, 6:00pm UTC](https://discuss.elastic.co/t/twitter-client-error-undefined-method/184206/3 "2019-06-04T18:00:26Z")

</div>

> [@mickey\_lubs](#):
>
> locations =\> " -26.195246, 28.034088"

locations should be a list of lat/lon pairs that specify a geo-box. I don't think you can request tweets from a specific location. My guess is that there was an exception at startup, so that [stream\_client](https://github.com/logstash-plugins/logstash-input-twitter/blob/9cc21d940af6daa731582498efb33d52757585b6/lib/logstash/inputs/twitter.rb#L138) never got created.

---

<div class="post-metadata">

**Author:** ![mickey\_lubs](https://avatars.discourse-cdn.com/v4/letter/m/d78d45/32.png) [@mickey\_lubs](https://discuss.elastic.co/u/mickey_lubs)\
**Post date:** [June 4, 2019, 6:56pm UTC](https://discuss.elastic.co/t/twitter-client-error-undefined-method/184206/4 "2019-06-04T18:56:56Z")

</div>

Thanks for your insights Badger!  
I have figured it out ... had to use bounding box tool in CSV format to give me the type of coordinates it expects. So this one here would be for a zone in south africa that i have chosen "15.74,-34.99,32.33,-25.05", it works!  
[https://boundingbox.klokantech.com](https://boundingbox.klokantech.com)

---

<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 2, 2019, 6:57pm UTC](https://discuss.elastic.co/t/twitter-client-error-undefined-method/184206/5 "2019-07-02T18:57:05Z")

</div>

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