After upgrading to Logstash 8.11.3, our Logstash stopped working because it can no longer execute a script that needs Java. I believe this is caused by Logstash now using it's internally shipped JDK.
Logstash Exec Input Plugin Configuration
exec {
command => '/ourpath/wildfly/bin/jboss-cli.sh --controller=localhost:9990 --user=admin --password=******** --connect --command="/subsystem=datasources/data-source=OurDS/statistics=pool:read-resource(include-runtime=true)" --output-json'
interval => 30
}
Error
/ourpath/wildfly/bin/jboss-cli.sh: line 88: exec: java: not found
We made Logstash echo JAVA, JAVA_HOME and other variables to see what it can see, and it looks like it sees nothing.
This did work on our previous Logstash version, which I'm guessing was 8.7.0.
Anyone have any ideas how to fix this?
Potential solutions we have though about:
- Not using the internal Logstash JDK, but this seems like bad practice.
- Manually setting variables for Logstash, such as JAVA, JAVA_HOME, pointing to our local JDK.