Like Prometheus, but for logs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
loki/clients/cmd/logstash
renovate[bot] abb7460044
chore(deps): update logstash docker tag to v9 (main) (#17702)
1 week ago
..
lib/logstash/outputs feat(logstash): clients logstash output structured metadata support (#10899) 2 years ago
spec/outputs feat(logstash): clients logstash output structured metadata support (#10899) 2 years ago
.gitignore Loki/Promtail: Client Refactor (#3623) 4 years ago
Dockerfile chore(deps): update logstash docker tag to v9 (main) (#17702) 1 week ago
Gemfile Loki/Promtail: Client Refactor (#3623) 4 years ago
README.md Update logstash dependency in logstash-output-loki plugin (#4930) 3 years ago
Rakefile Loki/Promtail: Client Refactor (#3623) 4 years ago
logstash-output-loki.gemspec feat(logstash): clients logstash output structured metadata support (#10899) 2 years ago
loki-metadata.conf feat(logstash): clients logstash output structured metadata support (#10899) 2 years ago
loki-test.conf Loki/Promtail: Client Refactor (#3623) 4 years ago
loki.conf feat(logstash): clients logstash output structured metadata support (#10899) 2 years ago

README.md

Contributing to Loki Logstash Output Plugin

For information about how to use this plugin see this documentation.

Install dependencies

First, make sure you have JDK version 8 or 11 installed and you have set the JAVA_HOME environment variable.

You need to setup JRuby environment to build this plugin. Refer https://github.com/rbenv/rbenv for setting up your rbenv environment.

After setting up rbenv. Install JRuby

rbenv install jruby-9.2.10.0
rbenv local jruby-9.2.10.0

Check that the environment is configured

ruby --version
jruby 9.2.10

You should make sure you are running jruby and not ruby. If the command ruby --version still shows ruby and not jruby, check that PATH contains $HOME/.rbenv/shims and $HOME/.rbenv/bin. Also verify that you have this in your bash profile:

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

Then install bundler:

gem install bundler:2.1.4

Follow those instructions to install logstash before moving to the next section.

Build and test the plugin

Install required packages

git clone git@github.com:elastic/logstash.git
cd logstash
git checkout tags/v7.16.1
export LOGSTASH_PATH="$(pwd)"
export GEM_PATH="$LOGSTASH_PATH/vendor/bundle/jruby/2.5.0"
export GEM_HOME="$LOGSTASH_PATH/vendor/bundle/jruby/2.5.0"
./gradlew assemble
cd ..
ruby -S bundle config set --local path "$LOGSTASH_PATH/vendor/bundle"
ruby -S bundle install
ruby -S bundle exec rake vendor

Build the plugin

gem build logstash-output-loki.gemspec

Test

ruby -S bundle exec rspec

Alternatively if you don't want to install JRuby. Enter inside logstash-loki container.

docker build -t logstash-loki ./
docker run -v  $(pwd)/spec:/home/logstash/spec -it --rm --entrypoint /bin/sh logstash-loki
bundle exec rspec

Install plugin to local logstash

bin/logstash-plugin install --no-verify --local logstash-output-loki-1.0.0.gem

Send sample event and check plugin is working

bin/logstash -f loki.conf