Ok, so I've been dealing with this issue for a couple of days and it's becoming really frustrating.
I want to start logstash with systemctl start logstash.service
to have it in the background sending some metric logs to elasticsearch. But when the logstash server starts, nothing is sent to Elastic. with systemctl status logstash.service -l
I get this:
Nov 07 07:01:39 elk.nipne.ro logstash[13797]: [2019-11-07T07:01:39,644][ERROR][logstash.agent ] Fai
led to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:metricbeat-droplet, :exception=>
"LogStash::ConfigurationError", :message=>"Expected one of #, input, filter, output at line 1, column 2 (byte
2) after ", :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:41:in `compile_imperat
ive'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:49:in `compile_graph'", "/usr/share/logsta
sh/logstash-core/lib/logstash/compiler.rb:11:in `block in compile_sources'", "org/jruby/RubyArray.java:2584:i
n `map'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:10:in `compile_sources'", "org/logstash
/execution/AbstractPipelineExt.java:153:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:47
:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:26:in `initialize'", "/us
r/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:36:in `execute'", "/usr/share/logstash/
logstash-core/lib/logstash/agent.rb:326:in `block in converge_state'"]}
Nov 07 07:01:42 elk.nipne.ro logstash[13797]: [2019-11-07T07:01:42,642][ERROR][logstash.agent ] Fai
led to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:metricbeat-droplet, :exception=>
"LogStash::ConfigurationError", :message=>"Expected one of #, input, filter, output at line 1, column 2 (byte
2) after ", :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:41:in `compile_imperat
ive'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:49:in `compile_graph'", "/usr/share/logsta
sh/logstash-core/lib/logstash/compiler.rb:11:in `block in compile_sources'", "org/jruby/RubyArray.java:2584:i
n `map'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:10:in `compile_sources'", "org/logstash
/execution/AbstractPipelineExt.java:153:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:47
:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:26:in `initialize'", "/us
r/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:36:in `execute'", "/usr/share/logstash/
logstash-core/lib/logstash/agent.rb:326:in `block in converge_state'"]}
My pipepline is very basic because it only has one configuration file (honestly I don't even see the point in making a pipeline in the first place) but even if it's empty, I still get a similar error.
Here you can see:
Pipeline: (pipelines.yml)
- pipeline.id: metricbeat-droplet
path.config: "/etc/logstash/conf.d/digitalIngest.conf"
And conf file:
input {
beats {
port => 5044
ssl => true
ssl_certificate => "/etc/letsencrypt/live/elk.nipne.ro/fullchain.pem"
ssl_key => "/etc/letsencrypt/live/elk.nipne.ro/privkey.pem"
}
}
filter {
}
output{
elasticsearch {
hosts => "localhost:9200"
manage_template => false
index => "droplet-metrics-1"
}
}
What causes the pipeline to fail?
I'm on CentOS 7 by the way. If I go to /usr/share/logstash and start Logstash from the binaries, with the flag for configuration file, it WORKS (but that's only because when you flag something, the pipeline YAML file get's ignored)