-t:测试配置文件是否正确,然后退出。
wangshumin@CentOSNode1 logstash-5.3.1]$ bin/logstash --help
Sending Logstash's logs to /home/wangshumin/ekl/logstash-5.3.1/logs which is now configured via log4j2.propertiesERROR: No configuration file was specified. Perhaps you forgot to provide the '-f yourlogstash.conf' flag?
usage:
bin/logstash -f CONFIG_PATH [-t] [-r] [] [-w COUNT] [-l LOG]
bin/logstash -e CONFIG_STR [-t] [--log.level fatal|error|warn|info|debug|trace] [-w COUNT] [-l LOG]
bin/logstash -i SHELL [--log.level fatal|error|warn|info|debug|trace]
bin/logstash -V [--log.level fatal|error|warn|info|debug|trace]
bin/logstash --help
[wangshumin@CentOSNode1 logstash-5.3.1]$ bin/logstash -f myconfig/logstash-first.conf -t
Sending Logstash's logs to /home/wangshumin/ekl/logstash-5.3.1/logs which is now configured via log4j2.properties
[2018-04-29T13:21:08,977][FATAL][logstash.runner ] The given configuration is invalid. Reason: Expected one of #, ", ', } at line 3, column 1 (byte 20) after input {
file {
[wangshumin@CentOSNode1 logstash-5.3.1]$ vim myconfig/logstash-first.conf
[wangshumin@CentOSNode1 logstash-5.3.1]$ bin/logstash -f myconfig/logstash-first.conf -t
Sending Logstash's logs to /home/wangshumin/ekl/logstash-5.3.1/logs which is now configured via log4j2.properties
Configuration OK
[2018-04-29T13:22:39,969][INFO ][logstash.runner ] Using config.test_and_exit mode. Config Validation Result: OK. Exiting Logstash
[wangshumin@CentOSNode1 logstash-5.3.1]$