Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError"

Hi

I'm using logstash-7.0.1, my configuration file is:

input {

    stdout{}

}

output {

    elasticsearch {

                    hosts => {"localhost:9200"}

    }

    stdout {

            codec => rubydebug

    }

}

Logs:

[2019-08-01T10:17:42,206][INFO ][logstash.agent ] No persistent UUID file found. Generating new UUID {:uuid=>"6f6eee53-b466-4454-8e0e-46eb12189753", :path=>"/home/hduser_/jay/logstash-7.0.1/data/uuid"}

[2019-08-01T10:17:43,834][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, => at line 6, column 30 (byte 76) after output {\n\telasticsearch {\n\t\t\thosts => {"localhost:9200"", :backtrace=>["/home/hduser_/jay/logstash-7.0.1/logstash-core/lib/logstash/compiler.rb:41:in compile_imperative'", "/home/hduser_/jay/logstash-7.0.1/logstash-core/lib/logstash/compiler.rb:49:incompile_graph'", "/home/hduser_/jay/logstash-7.0.1/logstash-core/lib/logstash/compiler.rb:11:in block in compile_sources'", "org/jruby/RubyArray.java:2577:inmap'", "/home/hduser_/jay/logstash-7.0.1/logstash-core/lib/logstash/compiler.rb:10:in compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:151:ininitialize'", "org/logstash/execution/JavaBasePipelineExt.java:47:in initialize'", "/home/hduser_/jay/logstash-7.0.1/logstash-core/lib/logstash/java_pipeline.rb:23:ininitialize'", "/home/hduser_/jay/logstash-7.0.1/logstash-core/lib/logstash/pipeline_action/create.rb:36:in execute'", "/home/hduser_/jay/logstash-7.0.1/logstash-core/lib/logstash/agent.rb:325:inblock in converge_state'"]}

[2019-08-01T10:17:44,268][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}

[2019-08-01T10:17:49,200][INFO ][logstash.runner ] Logstash shut down.

Am I doing anything wrong here?

Hi @hitesh_kumar,

Could you please try with below format in your output plugin?

output {
  elasticsearch { hosts => ["localhost:9200"] }
  stdout { codec => rubydebug }
}   

As its showing error in your o/p plugin.

Regards,
Harsh Bajaj

Also, there is no 'stdout {}' input plugin. Did you mean 'stdin {}'?