I am trying to install the
jdbc-mysql gem in a dockerized Logstash (after I miserably failed to set
Xcext.enabled=true and use the
In the Dockerfile I am first running this
RUN env GEM_HOME=/opt/logstash/vendor/bundle/jruby/1.9 /usr/share/logstash/vendor/jruby/bin/jruby /usr/share/logstash/vendor/jruby/bin/gem install jdbc-mysql
to install the gem and then the following to add it to the filter's gemspec:
RUN head -n -2 ./vendor/bundle/jruby/1.9/gems/logstash-filter-ruby-3.0.2/logstash-filter-ruby.gemspec > ./vendor/bundle/jruby/1.9/gems/logstash-filter-ruby-3.0.2/logstash-filter-ruby.gemspec.temp; mv ./vendor/bundle/jruby/1.9/gems/logstash-filter-ruby-3.0.2/logstash-filter-ruby.gemspec.temp ./vendor/bundle/jruby/1.9/gems/logstash-filter-ruby-3.0.2/logstash-filter-ruby.gemspec
RUN echo "s.add_runtime_dependency 'jdbc-mysql\nend'" >> ./vendor/bundle/jruby/1.9/gems/logstash-filter-ruby-3.0.2/logstash-filter-ruby.gemspec
But it's still not working, but complainig like so:
ERROR logstash.filters.ruby - Ruby exception occurred: no such file to load -- jdbc/mysql
Is this actually the right way to do it? Or is there another, better and easier way to achieve this? All I really want to do is query MySQL from that filter.
I am lost ...help!