由于配置错误无法启动 logstash
Cannot start up logstash because of config error
所以我正在设置 ELK,我成功安装了 elastic 和 kibana,但在启动 logsearch 时出错,这是错误
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jruby.ext.openssl.SecurityHelper (file:/C:/Users/10992005/AppData/Local/Temp/jruby-8888/jruby13233270349330806025jopenssl.jar) to field java.security.MessageDigest.provider
WARNING: Please consider reporting this to the maintainers of org.jruby.ext.openssl.SecurityHelper
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Sending Logstash logs to D:/new_logging/logstash-7.9.2/logs which is now configured via log4j2.properties
[2021-03-17T14:33:41,160][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"7.9.2", "jruby.version"=>"jruby 9.2.13.0 (2.5.7) 2020-08-03 9a89c94bcc Java HotSpot(TM) 64-Bit Server VM 11.0.8+10-LTS on 11.0.8+10-LTS +indy +jit [mswin32-x86_64]"}
[2021-03-17T14:33:41,441][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2021-03-17T14:33:42,349][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of [ \t\r\n], \"#\", \"{\" at line 13, column 16 (byte 244) after output {\n\tstdou
t{ codec => rubydebug }\n\telasticsearch ", :backtrace=>["D:/new_logging/logstash-7.9.2/logstash-core/lib/logstash/compiler.rb:32:in `compile_imperative'", "org/logstash/execution/AbstractPipelineExt.java:183:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:69:in `initialize'", "D:
/new_logging/logstash-7.9.2/logstash-core/lib/logstash/java_pipeline.rb:44:in `initialize'", "D:/new_logging/logstash-7.9.2/logstash-core/lib/logstash/pipeline_action/create.rb:52:in `execute'", "D:/new_logging/logstash-7.9.2/logstash-core/lib/logstash/agent.rb:357:in `block in converge_state'"]}
[2021-03-17T14:33:42,685][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2021-03-17T14:33:47,766][INFO ][logstash.runner ] Logstash shut down.
[2021-03-17T14:33:47,779][ERROR][org.logstash.Logstash ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit
据我所知,这是 logstash 配置问题,但我不知道错误在哪里(虽然错误确实告诉我它在第 13 行,但我不知道出了什么问题),我是 ELK 的新手,请告诉我如何修复它
这是 logstash 配置
# Sample Logstash configuration for creating a simple
# Beats -> Logstash -> Elasticsearch pipeline.
input {
file{
type => "syslog"
path => "D:/new_logging/log/application.log"
}
}
output {
stdout{ codec => rubydebug }
elasticsearch => {
hosts => ["localhost:9200"]
index => "testing"
}
}
您的问题正好在第 13 行:elasticsearch => {
,请删除 =>
(https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html)
# Sample Logstash configuration for creating a simple
# Beats -> Logstash -> Elasticsearch pipeline.
input {
file{
type => "syslog"
path => "D:/new_logging/log/application.log"
}
}
output {
stdout { codec => rubydebug }
elasticsearch {
hosts => ["localhost:9200"]
index => "testing"
}
}
所以我正在设置 ELK,我成功安装了 elastic 和 kibana,但在启动 logsearch 时出错,这是错误
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jruby.ext.openssl.SecurityHelper (file:/C:/Users/10992005/AppData/Local/Temp/jruby-8888/jruby13233270349330806025jopenssl.jar) to field java.security.MessageDigest.provider
WARNING: Please consider reporting this to the maintainers of org.jruby.ext.openssl.SecurityHelper
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Sending Logstash logs to D:/new_logging/logstash-7.9.2/logs which is now configured via log4j2.properties
[2021-03-17T14:33:41,160][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"7.9.2", "jruby.version"=>"jruby 9.2.13.0 (2.5.7) 2020-08-03 9a89c94bcc Java HotSpot(TM) 64-Bit Server VM 11.0.8+10-LTS on 11.0.8+10-LTS +indy +jit [mswin32-x86_64]"}
[2021-03-17T14:33:41,441][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2021-03-17T14:33:42,349][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of [ \t\r\n], \"#\", \"{\" at line 13, column 16 (byte 244) after output {\n\tstdou
t{ codec => rubydebug }\n\telasticsearch ", :backtrace=>["D:/new_logging/logstash-7.9.2/logstash-core/lib/logstash/compiler.rb:32:in `compile_imperative'", "org/logstash/execution/AbstractPipelineExt.java:183:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:69:in `initialize'", "D:
/new_logging/logstash-7.9.2/logstash-core/lib/logstash/java_pipeline.rb:44:in `initialize'", "D:/new_logging/logstash-7.9.2/logstash-core/lib/logstash/pipeline_action/create.rb:52:in `execute'", "D:/new_logging/logstash-7.9.2/logstash-core/lib/logstash/agent.rb:357:in `block in converge_state'"]}
[2021-03-17T14:33:42,685][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2021-03-17T14:33:47,766][INFO ][logstash.runner ] Logstash shut down.
[2021-03-17T14:33:47,779][ERROR][org.logstash.Logstash ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit
据我所知,这是 logstash 配置问题,但我不知道错误在哪里(虽然错误确实告诉我它在第 13 行,但我不知道出了什么问题),我是 ELK 的新手,请告诉我如何修复它 这是 logstash 配置
# Sample Logstash configuration for creating a simple
# Beats -> Logstash -> Elasticsearch pipeline.
input {
file{
type => "syslog"
path => "D:/new_logging/log/application.log"
}
}
output {
stdout{ codec => rubydebug }
elasticsearch => {
hosts => ["localhost:9200"]
index => "testing"
}
}
您的问题正好在第 13 行:elasticsearch => {
,请删除 =>
(https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html)
# Sample Logstash configuration for creating a simple
# Beats -> Logstash -> Elasticsearch pipeline.
input {
file{
type => "syslog"
path => "D:/new_logging/log/application.log"
}
}
output {
stdout { codec => rubydebug }
elasticsearch {
hosts => ["localhost:9200"]
index => "testing"
}
}