# Twitter input raising errors when using "@" into the keyword config

**URL:** <https://discuss.elastic.co/t/twitter-input-raising-errors-when-using-into-the-keyword-config/99677>\
**Category:** Logstash\
**Created:** [September 7, 2017, 7:53am UTC](https://discuss.elastic.co/t/twitter-input-raising-errors-when-using-into-the-keyword-config/99677 "2017-09-07T07:53:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Melvyn\_Peignon](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@Melvyn\_Peignon](https://discuss.elastic.co/u/Melvyn_Peignon)\
**Post date:** [September 7, 2017, 7:53am UTC](https://discuss.elastic.co/t/twitter-input-raising-errors-when-using-into-the-keyword-config/99677/1 "2017-09-07T07:53:50Z")

</div>

I have a pipeline using twitter input:

```
input {
  twitter {
      consumer_key => "key"
      consumer_secret => "key"
      oauth_token => "key"
      oauth_token_secret => "key"
      keywords => ["Microsoft"]
      full_tweet => true
      type => "tweet"
  }
}

```

This pipeline works fine and collect data but an error raise when you add the user mention symbol:

```
input {
  twitter {
      consumer_key => "key"
      consumer_secret => "key"
      oauth_token => "key"
      oauth_token_secret => "key"
      keywords => ["@Microsoft"]
      full_tweet => true
      type => "tweet"
  }
}

```

Which raise the following:

```
{  
:message=>"",
: exception=>"Twitter:: Error::Unauthorized",
:backtrace=> [  
      "/usr/local/Cellar/logstash/5.5.2/libexec/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 `<<'",
      "/usr/local/Cellar/logstash/5.5.2/libexec/vendor/bundle/jruby/1.9/gems/twitter-5.15.0/lib/twitter/streaming/response.rb:16:in `<<'",
      "/usr/local/Cellar/logstash/5.5.2/libexec/vendor/bundle/jruby/1.9/gems/logstash-input-twitter-3.0.5/lib/logstash/inputs/twitter/patches.rb:31:in `stream'",
      "/usr/local/Cellar/logstash/5.5.2/libexec/vendor/bundle/jruby/1.9/gems/logstash-input-twitter-3.0.5/lib/logstash/inputs/twitter/patches.rb:58:in `request'",
      "/usr/local/Cellar/logstash/5.5.2/libexec/vendor/bundle/jruby/1.9/gems/twitter-5.15.0/lib/twitter/streaming/client.rb:37:in `filter'",
      "/usr/local/Cellar/logstash/5.5.2/libexec/vendor/bundle/jruby/1.9/gems/logstash-input-twitter-3.0.5/lib/logstash/inputs/twitter.rb:138:in `run'",
      "/usr/local/Cellar/logstash/5.5.2/libexec/logstash-core/lib/logstash/pipeline.rb:456:in `inputworker'",
      "/usr/local/Cellar/logstash/5.5.2/libexec/logstash-core/lib/logstash/pipeline.rb:449:in `start_input'"
   ],
:options=>nil
}

```

Then after "ctrl + c" the pipeline the following error is raised:

`[2017-09-07T15:30:01,250][WARN][logstash.inputs.twitter] Twitter client error`

```
{  
: message=>"undefined method `filter' for nil:NilClass",
:exception=>"NoMethodError",
:backtrace=> [  
      "/usr/local/Cellar/logstash/5.5.2/libexec/vendor/bundle/jruby/1.9/gems/logstash-input-twitter-3.0.5/lib/logstash/inputs/twitter.rb:138:in `run'",
      "/usr/local/Cellar/logstash/5.5.2/libexec/logstash-core/lib/logstash/pipeline.rb:456:in `inputworker'",
      "/usr/local/Cellar/logstash/5.5.2/libexec/logstash-core/lib/logstash/pipeline.rb:449:in `start_input'"
   ],
:options=>nil
}

```

I used tweepy to collect tweet and it's work fine when using user mention? Does this error come from my configuration, Logstash or Twitter?

---

<div class="post-metadata">

**Author:** ![Dede198904](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@Dede198904](https://discuss.elastic.co/u/Dede198904)\
**Post date:** [September 19, 2017, 1:07pm UTC](https://discuss.elastic.co/t/twitter-input-raising-errors-when-using-into-the-keyword-config/99677/2 "2017-09-19T13:07:30Z")

</div>

I am observing the exact same behavior. It would be nice if someone would provide a solution.

---

<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:** [October 17, 2017, 1:07pm UTC](https://discuss.elastic.co/t/twitter-input-raising-errors-when-using-into-the-keyword-config/99677/3 "2017-10-17T13:07:31Z")

</div>

Closed on October 17, 2017, 1:07pm UTC

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