-
-
Save alexalouit/a857a6de10dfdaf7485f7c0cccadb98c to your computer and use it in GitHub Desktop.
#!/bin/bash | |
# based on https://github.com/mew2057/CAST/blob/6c7f7d514b7af3c512635ec145aa829c535467dc/csm_big_data/config-scripts/logstashFixupScript.sh | |
# see: https://github.com/elastic/logstash/issues/10755 | |
apt-get update | |
apt-get install -f zip unzip | |
STARTDIR=$(pwd) | |
JARDIR="/usr/share/logstash/logstash-core/lib/jars" | |
JAR="jruby-complete-9.2.9.0.jar" | |
JRUBYDIR="${JAR}-dir" | |
PLATDIR="META-INF/jruby.home/lib/ruby/stdlib/ffi/platform/arm-linux" | |
cd ${JARDIR} | |
unzip -d ${JRUBYDIR} ${JAR} | |
cd "${JRUBYDIR}/${PLATDIR}" | |
cp -n types.conf platform.conf | |
cd "${JARDIR}/${JRUBYDIR}" | |
zip -r ${JAR} * | |
mv -f ${JAR} .. | |
cd ${JARDIR} | |
rm -rf ${JRUBYDIR} | |
chown logstash:logstash ${JAR} | |
sync | |
sync | |
cd ${STARTDIR} |
current jruby in JARDIR is jruby-complete-9.2.9.0.jar
May also want to add a way to use the version var in lines 21, 22, and 26 so you only have to change this in one place.
Many thanks for this! Helped me build my own Logstash image for my PI4
Thank you very much.
I ran the fix but still have the load error. Fix runs successfully and adds a platform.conf
What am I missing? Please assist.
PI4 with Ubuntu.
@osuide check the version or checkout this fix.sh that can help you with with newer versions (9.2.9.0+) for jruby / logstash:
https://gist.github.com/gwsales/5a27e6282063f902014d851247c5f448. There has been recent logstash releases that could be using a different version of jruby.
@gwsales I did manually update my script to ~11.1
It ran successfully and I have confirmed by unzipping the jar file that platfom.conf was actually added to the .jar.
Current release for jruby included in logstash: jruby-complete-9.2.11.1.jar
This script should be updated to auto discover jruby version with a find. I'll get around to it when I have time.
This should work:
JAR=$(basename $(find /usr/share/logstash/logstash-core/lib/jars/ -name "jruby-complete*.jar"))
Thanks, working also for jruby-complete-9.2.11.1.jar
Getting an error:
unzip: cannot find or open jruby-complete-9.2.7.0.jar, jruby-complete-9.2.7.0.jar.zip or jruby-complete-9.2.7.0.jar.ZIP.