i'm starting my logstash with command ./logstash -f logstash.conf & as a backend process.
i would like to generate a pid file in my logstash home directory.
How to achieve this.
For kibana i have used pid.file in kibana.yml file.
okay..let me try the systemd or other service..but my requirement is all the files related to ELK setup should be under the folder /opt/ELK/..
When i install filebeat as service....the filebeat.yml came up under etc/filebeat...
Hence checking for the other options...or is it possible to setup logstash as service but all the files under my custom folder i.e. /opt/ELK/..
currently i have a custom script which im using :
echo $sDate 'Start of Logstash' >> $LOG_FILE
echo $sDate 'Kill of Logstash' >> $LOG_FILE
logstashpid=lsof -i:9600 | grep 'LISTEN' | awk '{print $2}'
if [ -z '$logstashpid' ]
then
echo $sDate '$logstashpid is empty' >> $LOG_FILE
else
echo $sDate '$logstashpid is NOT empty' >> $LOG_FILE
echo $sDate 'logstashpid :'$logstashpid >> $LOG_FILE
kill -9 $logstashpid
fi
cd /opt/ELK/logstash-6.4.0/bin
export JAVA_HOME=/opt/ELK/jdk
./logstash -f logstash.conf &
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.