Error on starting logstash with twitter input plugin


(Amir Hossein Ma) #1

Hi
I will launch Logstash on the basis of this tutorial, 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:incompile_graph'", "C:/elk/logstash/logstash-core/lib/logstash/compiler.rb:12:in block in compile_sources'", "org/jruby/RubyArray.java:2486:inmap'", "C:/elk/logstash/logstash-core/lib/logstash/compiler.rb:11:in compile_sources'", "C:/elk/logstash/logstash-core/lib/logstash/pipeline.rb:51:ininitialize'", "C:/elk/logstash/logstash-core/lib/logstash/pipeline.rb:169:in initialize'", "C:/elk/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:40 :inexecute'", "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:inwith_pipelines'", "C:/elk/logstash/logstash-core/lib/logstash/agent.rb:312:in block in converge_state'", "org/jruby/RubyArray.java:1734:ineach'", "C:/elk/logstash/logstash-core/lib/logstash/agent.rb:299:in converge_state'", "C:/elk/logstash/logstash-core/lib/logstash/agent.rb:166:inblock 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:inconverge_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:inblock 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
}
}


(Magnus B├Ąck) #2

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".


(Amir Hossein Ma) #3

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


(system) #4

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