Are there updated docs on how to create a plugin somewhere?


(Dave B93) #1

Hi There,

I was attempting to create a plugin for graylog, and had some issues with the documentation here: http://docs.graylog.org/en/latest/pages/plugins.html

It’s telling me after I clone the graylog-project.git I should run $ scripts/bootstrap but that doesn’t exist.

Following the instructions on the graylog-project github project I got the graylog-project-cli from github and ran this instead

graylog-project bootstrap --manifest=“manifests/2.4.json” github://Graylog2/graylog-project.git

but now I’m wondering if there’s a way that I can do the equivalent of what the docs are telling me to do here:

scripts/bootstrap-plugin jira-alarmcallback

What I’ve done for now is cd to graylog-project-repos
git clone git@github.com:Graylog2/graylog-plugin-sample.git

But it looks like a LOT of search and rename, as well as moving files around will be required to modify this plugin to be it’s own entity.

Is this the recommended workflow?


(Philipp Ruland) #2

Heyo,

the closest to up-to-date would probably be something like this:

Greetings,
Philipp


(Dave B93) #3

I saw that, and it was helpful for getting the right branch set up with the bootstrap but it doesn’t actually detail bootstrapping a plugin at all.

The sample plugin does build there, but I’m not entirely sure everything I have to rename to get it to build my own plugin.jar

incidentally if someone does try bootstrapping but doesn’t specify the branch, then building the sample plugin does not work. for some reason you need to actually install yarn on the system. ( it seems like one of the scripts doesn’t reference yarn properly ) and you need to override which version of node is downloaded in the sample plugins pom.xml


(Dave B93) #4

in case anyone else was trying to write a plugin, here are some resources that I found helpful.


( basically this says, after you’ve bootstrapped graylog, if you want to compile your plugin without compiling graylog, you should run “mvn generate-resources” in the graylog-project-repos/graylog-project folder )

https://www.graylog.org/post/writing-your-own-graylog-processing-pipeline-functions
How to hook your plugin into graylog


if your plugin depends on graylog, then you need to set isolated=false in your graylog-plugin.properties file


(system) #5

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