biz.dfch.j.graylog2.plugin.output.execscript

License

Plugin: biz.dfch.j.graylog2.plugin.output.execscript

d-fens GmbH, General-Guisan-Strasse 6, CH-6300 Zug, Switzerland

This Graylog Output Plugin lets you run arbitrary scripts on a Graylog node.

See Creating a Graylog2 Output Plugin for further description and examples on how to use the plugin.

You can download the binary Build Status.

This plugin works with Graylog v1.

Getting started for users

To use this plugin, copy the JAR into the Graylog plugin directory (which is defined in Graylog.conf) and restart the Graylog node and make sure you deploy the plugin to every Graylog node in your environment.

You can then create scripts in any JSR.223 supported script engine (by default support for javascript, Python as JPython (v2.7-rc2) and Groovy (2.4.3) is installed). When configuring the plugin, you have to specify the full path to a script file that should be executed (and the name of the engine (i.e. javascript, python and groovy). Every time the specified script is executed it will be passed the message of type org.graylog2.plugin.Message as a variable into the script scope from where you can process it according to your needs.

Getting started for developers

This project is using Maven and requires Java 7 or higher.

  • Clone this repository.
  • Run mvn package to build a JAR file.
  • Optional: Run mvn jdeb:jdeb and mvn rpm:rpm to create a DEB and RPM package respectively.
  • Copy generated jar file in target directory to your Graylog2 server plugin directory (/opt/graylog2/plugin if you are using the Docker image).
  • Restart the Graylog server.

Other Plugins