I was using Opensearch to send logs to Logstash and then output the modified fields to another Opensearch when I stumbled upon this error:
[2025-05-28T06:57:49,669][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>“LogStash::ConfigurationError”, :message=>“Expected one of [ \t\r\n], "#", "input", "filter", "output" at line 6, column 1 (byte 132) after “, :backtrace=>[”/home/onizuwo/logstash-9.0.1/logstash-core/lib/logstash/compiler.rb:32:in `compile_imperative’”, “org/logstash/execution/AbstractPipelineExt.java:294:in `initialize’”, “org/logstash/execution/AbstractPipelineExt.java:227:in `initialize’”, “/home/onizuwo/logstash-9.0.1/logstash-core/lib/logstash/java_pipeline.rb:47:in `initialize’”, “org/jruby/RubyClass.java:949:in `new’”, “/home/onizuwo/logstash-9.0.1/logstash-core/lib/logstash/pipeline_action/create.rb:50:in `execute’”, “/home/onizuwo/logstash-9.0.1/logstash-core/lib/logstash/agent.rb:420:in `block in converge_state’”]}
I want to know how to solve it. As the error advised, I tried to provide a comment at line 6 or even leaving a blank space but nothing worked. I also typed the whole conf file by myself without copying and pasting from outside resources as I have seen that this might be the cause of the issue. However, this attempt also didnt work and I am still facing this error and cannot solve it.
Hence, I am posting on the community so that someone can explain to me what is the issue and why is it happening and how to solve. Ultimately, I want to know what I need to do to solve it. Can someone please guide me/advise me on this issue?