Logstash init script - how to change default variables values without modifying logstash script?

Hi,

I am using logstash software (2.2.4 version) on centos linux, and i want to change the default logstash log (LS_LOG_DIR) location to custom location (ex: /var/log/test) without modifying default init script (i.e /etc/init.d/logstash). Is that possible?

I tried setting up enviornment variables (ex: export LS_LOG_DIR=/var/log/test) to override default location, but it doesn't works...the service picks up default log location.

How to achieve overriding default values of logstash script without modifying default script?

LS_USER=logstash
LS_GROUP=logstash
LS_LOG_DIR=/var/log/logstash
LS_LOG_FILE="${LS_LOG_DIR}/$name.log"

Thanks,
Saravanan

This is exactly what /etc/sysconfig/logstash is for.

1 Like

Thanks Magnus!