# Error on starting logstash with twitter input plugin

**URL:** <https://discuss.elastic.co/t/error-on-starting-logstash-with-twitter-input-plugin/119873>\
**Category:** Logstash\
**Created:** [February 14, 2018, 7:50pm UTC](https://discuss.elastic.co/t/error-on-starting-logstash-with-twitter-input-plugin/119873 "2018-02-14T19:50:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AmirHossein\_Ma](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@AmirHossein\_Ma](https://discuss.elastic.co/u/AmirHossein_Ma)\
**Post date:** [February 14, 2018, 7:50pm UTC](https://discuss.elastic.co/t/error-on-starting-logstash-with-twitter-input-plugin/119873/1 "2018-02-14T19:50:38Z")

</div>

Hi  
I will launch Logstash on the basis of [this tutorial](https://github.com/elastic/examples/tree/master/Common%20Data%20Formats/twitter), but I encounter the following error  
I use current version of logstash on windows server 2008.

```
C:\elk\logstash>.\bin\logstash -f logstash.conf

```

Sending Logstash's logs to C:/elk/logstash/logs which is now configured via log4j2.properties  
[2018-02-14T11:35:45,925][INFO][logstash.modules.scaffold] Initializing module {:module\_name=\>"fb\_apache", :directory=\>"C:/elk/logstash/modules/fb\_apache/configuration"}  
[2018-02-14T11:35:45,956][INFO][logstash.modules.scaffold] Initializing module {:module\_name=\>"netflow", :directory=\>"C:/elk/logstash/modules/netflow/configuration"}  
[2018-02-14T11:35:46,550][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified  
[2018-02-14T11:35:47,628][INFO][logstash.runner] Starting Logstash {"logstash.version"=\>"6.2.1"}  
[2018-02-14T11:35:48,410][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}  
[2018-02-14T11:35:48,981][ERROR][logstash.agent] Failed to execute action {:action=\>LogStash::PipelineAction::Create/pipeline\_id:main, :exception=\>"LogStash::ConfigurationError", :message=\>"Expected one of #, input, filter, output at line 1, column 1 (byte 1) after ", :backtrace=\>["C:/elk/logstash/logstash-core/lib/logstash/compiler.rb:42:in `compile_imperative'", "C:/elk/logstash/logstash-core/lib/logstash/compiler.rb:50:in`compile\_graph'", "C:/elk/logstash/logstash-core/lib/logstash/compiler.rb:12:in `block in compile_sources'", "org/jruby/RubyArray.java:2486:in`map'", "C:/elk/logstash/logstash-core/lib/logstash/compiler.rb:11:in `compile_sources'", "C:/elk/logstash/logstash-core/lib/logstash/pipeline.rb:51:in`initialize'", "C:/elk/logstash/logstash-core/lib/logstash/pipeline.rb:169:in `initialize'", "C:/elk/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:40 :in`execute'", "C:/elk/logstash/logstash-core/lib/logstash/agent.rb:315:in `block in converge_state'", "C:/elk/logstash/logstash-core/lib/logstash/agent.rb:141:in`with\_pipelines'", "C:/elk/logstash/logstash-core/lib/logstash/agent.rb:312:in `block in converge_state'", "org/jruby/RubyArray.java:1734:in`each'", "C:/elk/logstash/logstash-core/lib/logstash/agent.rb:299:in `converge_state'", "C:/elk/logstash/logstash-core/lib/logstash/agent.rb:166:in`block in converge\_state\_and\_update'", "C:/elk/logstash/logstash-core/lib/logstash/agent.rb:141:in `with_pipelines'", "C:/elk/logstash/logstash-core/lib/logstash/agent.rb:164:in`converge\_state\_and\_update'", "C:/elk/logstash/logstash-core/lib/logstash/agent.rb:90:in `execute'", "C:/elk/logstash/logstash-core/lib/logstash/runner.rb:348:in`block in execute'", "C:/elk/logstash/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:24:in `bl  
ock in initialize'"]}

my config file

input {  
twitter {  
consumer\_key =\> "\_\_\_iQIzkm4F7GjDkyCHCiQ"  
consumer\_secret =\> "\_\_\_eRtIVg6IrspojErEi3Q7bCzlnCegXTZgq2KG8cfE"  
oauth\_token =\> "\_\_\_199358-XJlYRF6ZEFnor8xHhwyDrBQodtKOw8b8EabX3zPa"  
oauth\_token\_secret =\> "\_\_\_l06hmNmdCVyO0S6pbfoTlJqDc0qNIbywe6ucMjkeKT"  
keywords =\> ["thor", "spiderman", "wolverine", "ironman", "hulk"]  
full\_tweet =\> true  
}  
}

filter {}

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

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 14, 2018, 8:43pm UTC](https://discuss.elastic.co/t/error-on-starting-logstash-with-twitter-input-plugin/119873/2 "2018-02-14T20:43:06Z")

</div>

Wild guess: You edited the configuration file with an editor that put a byte-order mark at the very beginning of the file. Make sure your configuration file _really_ begins with an "i".

---

<div class="post-metadata">

**Author:** ![AmirHossein\_Ma](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@AmirHossein\_Ma](https://discuss.elastic.co/u/AmirHossein_Ma)\
**Post date:** [February 18, 2018, 6:00am UTC](https://discuss.elastic.co/t/error-on-starting-logstash-with-twitter-input-plugin/119873/3 "2018-02-18T06:00:54Z")

</div>

@magnusbaeck thanks for your reply.  
I change Encoding of config file from UTF-8 to ANSI and now work well!

---

<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:** [March 18, 2018, 6:01am UTC](https://discuss.elastic.co/t/error-on-starting-logstash-with-twitter-input-plugin/119873/4 "2018-03-18T06:01:14Z")

</div>

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