I am using logstash7 .2.0
Elasticsearch-7.2.0
Java-11.0.6
When I check the status after starting it shows Active:Failed.
$: systemctl status logstash.service
â logstash.service - logstash
Loaded: loaded (/etc/systemd/system/logstash.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2020-01-22 08:04:59 EST; 37s ago
Main PID: 12167 (code=exited, status=1/FAILURE)
systemd[1]: logstash.service: Service hold-off time over, scheduling restart.
Jan 22 08:04:59 xxxxxxx systemd[1]: logstash.service: Scheduled restart job, restart counter is at 5.
Jan 22 08:04:59 xxxxxxx systemd[1]: Stopped logstash.
Jan 22 08:04:59 xxxxxxx systemd[1]: logstash.service: Start request repeated too quickly.
Jan 22 08:04:59 xxxxxxx systemd[1]: logstash.service: Failed with result 'exit-code'.
Jan 22 08:04:59 xxxxxxx systemd[1]: Failed to start logstash.
I am trying this on also as below cd /usr/share/logstash
sudo bin/logstah -f /etc/logstash/conf.d/example.conf
but it shows below error:
:/usr/share/logstash# sudo /usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/example.conf could not find java; set JAVA_HOME or ensure java is in PATH
As the error message states, you need to have a valid java on your PATH, or need to have an environment variable JAVA_HOME that points to a valid java.
The paths might be all broken if you install dependencies and other stuff as root user without using "sudo" before each command you'll most likely end-up with think not working.
My advice is to re install java with sudo as normal user and then start logstash.
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.