Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add gems into Logstash

I am running Logstash 1.4.1, comparing to the latest, I can't find anywhere in my installation folders contains gem information (versus the latest code in github has those gembag.rb, Gemfile etc..)

My current issue is I need to use several gems that Logstash doesn't have out of box, simply require 'gemname' seems doesn't work. Could anyone direct me to the readings that explains how to add these 3rd party gems or show me some sample codes which can do this.

Thanks very much!

like image 809
James Jiang Avatar asked Nov 30 '22 11:11

James Jiang


2 Answers

cd /opt/logstash
env GEM_HOME=vendor/bundle/jruby/1.9 GEM_PATH="" java -jar vendor/jar/jruby-complete-1.7.11.jar -S gem install gemname

If you're installing a local gem file, put the path to the file in GEM_PATH.

like image 160
Alain Collins Avatar answered Dec 06 '22 18:12

Alain Collins


I think the simplest way is:

/usr/share/logstash/bin/ruby -S gem install <gem-name>

or

/opt/logstash/bin/ruby -S gem install <gem-name>

Work for me on recent version of logstash...

like image 38
Alex Simenduev Avatar answered Dec 06 '22 17:12

Alex Simenduev