Web Plugin Integration

Hi,

I am trying to implement a simple web plugin into graylog (V4.0.0).

I compiled a simple project available on this repo: GitHub - Graylog2/graylog-plugin-sample: Sample plugin for Graylog 2.0 including web ui parts.

The compilation succeeded. However after I placed my .jar plugin into the /usr/share/graylog-server/plugin folder, the plugin did not seem to be available.

When I check the installed plugin in Nodes → details section, I see the plugin is taken into account. But the basic /sample endpoint does not work and I get a “Page not found” error.

Does anyone have an idea of what could be the cause of this problem ?

Hello && welcome @weird-oecophylla

By chance did you restart GL service?

Thanks !

Yes I did restart the graylog-server service.

I think if I did not restart the service, I would not have seen my custom plugin in the installed plugins section anyway.

I compiled the graylog-plugin-collector and uploaded its .jar and the same problem appear: The collector plugin is present in installed plugins section but the Menu and /system/collectors endpoint are missing and I get a page not found error.

Moreover there is no error in graylog-server logs so it is really complicated to troobleshoot

This is the main test I tried:

../graylog-project bootstrap  https://github.com/Graylog2/graylog-project.git --manifest="manifests/3.3.json"
cd graylog-project
JAVA_HOME=../jdk-9.0.4 mvn package -DskipTests -Dmaven.wagon.http.ssl.insecure=true
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for graylog-project 3.3.17-SNAPSHOT:
[INFO] 
[INFO] Graylog Parent POM ................................. SUCCESS [  0.003 s]
[INFO] Graylog Project Parent POM ......................... SUCCESS [  0.115 s]
[INFO] Graylog ............................................ SUCCESS [03:36 min]
[INFO] Graylog Plugin Parent POM .......................... SUCCESS [  0.001 s]
[INFO] Graylog Plugin with Web support Parent POM ......... SUCCESS [  1.829 s]
[INFO] graylog-plugin-collector ........................... SUCCESS [ 58.250 s]
[INFO] graylog-plugin-aws ................................. SUCCESS [ 48.354 s]
[INFO] graylog-plugin-threatintel ......................... SUCCESS [ 57.381 s]
[INFO] graylog-plugin-integrations ........................ SUCCESS [ 56.163 s]
[INFO] graylog-project .................................... SUCCESS [  1.886 s]
[INFO] runner ............................................. SUCCESS [  0.604 s]
[INFO] integration-tests .................................. SUCCESS [  0.932 s]
[INFO] full-backend-tests ................................. SUCCESS [  0.438 s]
[INFO] graylog-plugin-archetype ........................... SUCCESS [  0.407 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

Then I uploaded graylog-plugin-collector-3.3.17-SNAPSHOT.jar of the collector plugin to my ova graylog 4.0.0. (I tried with some other versions without other result)

I also tested with empty cache.

This is what I observed:

  • The plugin is set as installed in the installed plugins section ( Nodes → Details)
  • The plugin is not present in configuration section
  • No log are registered from /var/log/graylog-server/ folder log

Does anyone have a guideline for compiling and integrating a simple web ui plugin adding a simple page accessible through the navbar ?

I saw many topics talking about installed plugin which are not accessible from the ui. But none of the evoked solution solved the problem on my side.


Hello,

Thank you for the added details.

Correct me if I’m wrong, Your using GL 4.0 and trying to install Collector Plugin 3.3?

If so,

The Graylog Collector Sidecar is deprecated and can be replaced with Graylog Sidecar

Out of curiosity, Is this what your trying to achieve as shown below?

If so, I did a test as follow:
Navigated to PLUGIN directory and deleted graylog-plugin-collector-4.2.7.jar
root# rm -rf graylog-plugin-collector-4.2.7.jar
Restarted Graylog service to make sure the plugin was not there.
Executed a re-install
root# yum reinstall graylog-server

Results.

if you noticed the plugin is the right version, took 2 seconds.

As a precaution I have copied my server.config file & I do have my repo pinned so it will not upgrade to a different version.

If this is a Virtual machine the easiest way is to make a checkpoint incase something goes wrong.

Hope that helps

EDIT: I was looking into this further here
Are you trying to create a different plugin then the default ones?

1 Like

Thanks a lot for your solution !

My initial objective was to create a custom plugin. I succeeded by just modifying the web source code of the previous plugin.

Glad you resolved your issue.
I’ll be honest, I’m curious on creating my own plugin and this was a good learning experience.

1 Like

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