I am trying to set up multiple logstash instances running on one host. I'm doing this by modifying the $name variable in the init script and modifying logfile output names and path to config etc. This works fine except that the logfile name and path seems to be hard coded somewhere such that the value set in the init script is ignored.
I assume this is set somewhere under /opt/logstash. Could someone point me to this setting so I can avoid multiple instances writing to s single file?
You're setting $NAME (not $name), right? That's what goes into $LS_LOG_DIR.
The variable defined in the init script is $name. Regardless of what LS_LOG_DIR is set to the log directory path stays fixed, as does the log file name...
The variable defined in the init script is $name.
Ah, right. I was looking in logstash.sys.debian where the variable is named $NAME while it indeed is $name in logstash.sysv.
Regardless of what LS_LOG_DIR is set to the log directory path stays fixed, as does the log file name...
What does your Logstash command line look like (
ps aux | grep logstash should do)?
I've sorted it out. Those settings were being overridden by the defaults file under /etc/default.