Hello, i have installed elasticsearch, created template (server-logs) and started the service on 9200
Also, added below code in logstash config file but when i try to start logstash service it is throwing an error
input {
file {
path => "/Users/bhargavramreddy/eclipse-workspace/Servers/maps/output.log"
}
}
filter {
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => “logs-%{+YYYY.MM.dd}”
manage_template => true
template_name => "server-logs"
}
stdout {}
}
Can anyone help me with the solution? what's wrong here ?
ERROR LOG:
Bhargavs-MacBook-Pro:logstash-7.1.1 bhargavramreddy$ bin/logstash -f config/logstash-sample.conf
Sending Logstash logs to /Users/bhargavramreddy/Downloads/logstash-7.1.1/logs which is now configured via log4j2.properties
[2019-05-29T17:12:04,977][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2019-05-29T17:12:04,998][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"7.1.1"}
[2019-05-29T17:12:06,191][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, ", ', -, [, { at line 16, column 14 (byte 290) after output {\n elasticsearch {\n \thosts => ["localhost:9200"]\n \tindex => ", :backtrace=>["/Users/bhargavramreddy/Downloads/logstash-7.1.1/logstash-core/lib/logstash/compiler.rb:41:in compile_imperative'", "/Users/bhargavramreddy/Downloads/logstash-7.1.1/logstash-core/lib/logstash/compiler.rb:49:in
compile_graph'", "/Users/bhargavramreddy/Downloads/logstash-7.1.1/logstash-core/lib/logstash/compiler.rb:11:in block in compile_sources'", "org/jruby/RubyArray.java:2577:in
map'", "/Users/bhargavramreddy/Downloads/logstash-7.1.1/logstash-core/lib/logstash/compiler.rb:10:in compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:151:in
initialize'", "org/logstash/execution/JavaBasePipelineExt.java:47:in initialize'", "/Users/bhargavramreddy/Downloads/logstash-7.1.1/logstash-core/lib/logstash/java_pipeline.rb:23:in
initialize'", "/Users/bhargavramreddy/Downloads/logstash-7.1.1/logstash-core/lib/logstash/pipeline_action/create.rb:36:in execute'", "/Users/bhargavramreddy/Downloads/logstash-7.1.1/logstash-core/lib/logstash/agent.rb:325:in
block in converge_state'"]}
[2019-05-29T17:12:06,502][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2019-05-29T17:12:11,556][INFO ][logstash.runner ] Logstash shut down.