Plugin Development


(Debasish) #1

Hi All,

I am new to Graylog, I would like to know about plugins development from scratch, can anyone please share some docs or info’s? I tried to mimic graylog-plugin-collector and develop a new plugin, it got compiled successfully and upon putting the .jar file in /usr/share/graylog-server/plugins graylog server continuously restarts automatically.

Thanks in advance


(Jochen) #2

Please refer to http://docs.graylog.org/en/2.3/pages/plugins.html


(Debasish) #3

Hi,

Can you please let me know on any sample plugin which can work out of box…

Thanks


(Jochen) #4

You can peek at the official plugins in the Graylog2 GitHub organization:

https://github.com/Graylog2?q=plugin


(Bill Murrin) #5

I forked the 2.2 branch of graylog-plugin-sample and got it working for 2.3 with a few minor tweaks. I’ve submitted a pull request to update the main project.

Until then, you can try it out here:

git clone -b "2.3" https://github.com/billmurrin/graylog-plugin-sample.git

Now you can clone the 2.3.0 branch of the Graylog repo, run npm install and then build your vendor manifest

git clone -b "2.3.0" https://github.com/Graylog2/graylog2-server.git
cd graylog2-server/graylog2-web-interface
npm install
webpack --config webpack.vendor.js

After that is done, in the graylog-plugin-sample folder, do the following:

npm install
mvn package

The mvn package should succeed and you should be able to add the jar from the graylog-plugin-sample/target folder to your plugin directory on your Graylog server and have it run.

If you want to do hot-reloading with the webpack dev server (makes working with React way easier) you need to modify the graylog2-server/graylog2-web-interface/config.js file to suit your needs and then run npm start.

cd graylog2-server/graylog2-web-interface

#Modify the config.js file
vim config.js

#Start the server
npm start

Your plugin will be automatically included as long as it meets the following criteria set forth in the graylog2-server/graylog2-web-interface/webpack.combined.config.js file.

  1. You plugin directory is located two directories away (…/…/graylog-plugin-sample) from the graylog2-web-interface directory
  2. The name of the plugin folder starts with graylog-plugin-

Example

MAIN_DIR
|- graylog2-server (../)
     |- graylog2-web-interface (../../)
|- graylog2-plugin-sample (../)

I hope that makes sense, please let me know if I can be of any assistance.


(system) #6

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.