Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, ,, ]

I run cmd .\logstash -e 'input{stdin{}} output{ elasticsearch{ hosts=>["127.0.0.1:9200"] } }' ; then have following errors.
[2018-12-20T18:47:55,667][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, ,, ] at line 1, column 53 (byte 53) after output{ elasticsearch{ hosts=>[127.0", :backtrace=>["D:/ELK/logstash-6.5.1/logstash-core/lib/logstash/compiler.rb:41:in compile_imperative'", "D:/ELK/logstash-6.5.1/logstash-core/lib/logstash/compiler.rb:49:incompile_graph'", "D:/ELK/logstash-6.5.1/logstash-core/lib/logstash/compiler.rb:11:in block in compile_sources'", "org/jruby/RubyArray.java:2486:inmap'", "D:/ELK/logstash-6.5.1/logstash-core/lib/logstash/compiler.rb:10:in compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:149:ininitialize'", "D:/ELK/logstash-6.5.1/logstash-core/lib/logstash/pipeline.rb:22:in initialize'", "D:/ELK/logstash-6.5.1/logstash-core/lib/logstash/pipeline.rb:90:ininitialize'", "D:/ELK/logstash-6.5.1/logstash-core/lib/logstash/pipeline_action/create.rb:42:in block in execute'", "D:/ELK/logstash-6.5.1/logstash-core/lib/logstash/agent.rb:92:inblock in exclusive'", "org/jruby/ext/thread/Mutex.java:148:in synchronize'", "D:/ELK/logstash-6.5.1/logstash-core/lib/logstash/agent.rb:92:inexclusive'", "D:/ELK/logstash-6.5.1/logstash-core/lib/logstash/pipeline_action/create.rb:38:in execute'", "D:/ELK/logstash-6.5.1/logstash-core/lib/logstash/agent.rb:317:inblock in converge_state'"]}

image

if i do not add elasticsearch,it can run success.
my elasticsearch service is still running!

try like this and check the response.

input{stdin{}}output{stdout{}}

If this works,
use localhost in place of 127.0.0.1

i try it,but it does not work.

then i try write it to conf file. i run cmd .\logstash -f .\test.conf ,it actually works.

but i still do not know the reason on run cmd .\logstash -e 'input{stdin{}} output{ elasticsearch{ hosts=>["localhost:9200"] }

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