Name: buildpack-logstash
Owner: FT Interactive News
Description: Buildpack to grab logstash
Forked from: Financial-Times/buildpack-logstash
Created: 2017-01-22 18:41:43.0
Updated: 2017-01-22 18:41:46.0
Pushed: 2017-01-24 13:13:40.0
Homepage: null
Size: 16
Language: Shell
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Buildpack to grab Logstash.
To use:
Ensure your logstash config is named logstash.conf and is in the root of your app. A sample config is provided.
Add the buildpack:
$ heroku buildpacks:add https://github.com/ft-interactive/buildpack-logstash
Set LOGSTASH_VERSION config variable:
$ heroku config:add LOGSTASH_VERSION="2.4.0"
The buildpack defaults to 5.1.2, which needs Java 8. Heroku defaults to Java 7; to get 8, use the
jvm-common
buildpack and put it at the front of your stack:
$ heroku buildpacks:add -i 1 https://github.com/heroku/heroku-buildpack-jvm-common.git
Add Logstash to your Procfile:
$ echo "logstash: logstash/bin/logstash -f logstash.conf" >> Procfile
N.b., if using Logstash 2.4.0 (the latest non-5.x release), you may need to add modify this to:
$ echo "logstash: logstash/bin/logstash --allow-env -f logstash.conf" >> Procfile
…To allow environment variables in config files. If using ElasticSearch, you'll need to ensure that the index is created before pushing data to it as well.
Commit and push:
$ git add Procfile
$ git commit -m "Adding Logstash"
$ git push heroku master
Scale up your Logstash dyno:
$ heroku ps:scale logstash=1
You should now be ingesting data via Logstash! Note that Logstash is kinda tempermental and you should really review your logs to ensure it's working.
Note, this presently doesn't work because of some issue with how the Heroku slug compiler uses Ruby. If you need a custom plugin, I recommend installing it post-build by setting your Procfile as such:
logstash: logstash/bin/logstash-plugin install logstash-output-slack; logstash/bin/logstash -f logstash.conf
~~This is optional. To set a list of Logstash plugins to install, supply an env var named LOGSTASH_PLUGINS with each item separated by semi-colon:~~
~~LOGSTASH_PLUGINS="logstash-output-slack;logstash-input-websocket"
~~