Logstash 服务不使用配置

Logstash service doesnt use config

Logstash 服务不想读取我在 /etc/logstash/conf.d/ 中的 conf 文件。 服务始终 运行。

例如:

...
output {
    stdout { codec => rubydebug }
    file { path => "/home/vagrant/LOGSTASH_TEST.txt" }
}

文件中没有添加任何内容。

但是当我 运行 bin/logstash -f /etc/logstash/conf.d/myconfig.conf — 一切都很好。

/etc/init.d/logstash 看起来不错:

LS_CONF_DIR=/etc/logstash/conf.d
...
program=/opt/logstash/bin/logstash
args="agent -f ${LS_CONF_DIR} -l ${LS_LOG_FILE} ${LS_OPTS}"

可能是什么问题?

尝试将 /etc/init.d/logstash 更改为:

LS_CONF_DIR=/etc/logstash/conf.d
LS_CONF_FILE=myconfig.conf
...
program=/opt/logstash/bin/logstash
args="agent -f ${LS_CONF_DIR}/${LS_CONF_FILE} -l ${LS_LOG_FILE} ${LS_OPTS}"