Hi all,
We are currently working on the idea of a Graylog Web plugin.
For that I’ve been stumbling through the setup process and got to a point where i have OpenSearch, MongoDB and the Graylog Server source code
(I had to manually downgrade from master to version 6.0.4 as the graylog project CLI does not support versions 5 and 6 yet as far as I could tell)
running on a Linux VM in a way that works (I can log in, view the different tabs and all that).
The only thing that seems to not work in the running interface is the predefined Sources Dashboard that results in There was an error fetching a resource: Internal Server Error. Additional information: IOException encountered while parsing
. I don’t need to have that solved necessarily as long as Graylog itself is running correctly, just wanted to mention in case it helps for the further questions.
I’m running the server using IntelliJ via SSH on the VM. How do I get the plugin to show up in the web interface?
Using mvn package to compile it and putting the JAR in the plugins folder results in the server log saying that it’s loaded but it appears nowhere (as far as i can tell, not even in the plugin list under confifguration).
Using the commands under Create Web Plugins (Plugins) results in a yarn error:
warning package.json: License should be a valid SPDX license expression
$ webpack serve -c webpack.bundled.ts
Building vendor bundle.
Running in development (no HMR) mode
[webpack-cli] Failed to load '/home/fewagner/git/graylog-project-repos/graylog2-server/graylog2-web-interface/webpack.bundled.ts' config
[webpack-cli] Error: Cannot find module 'graylog-web-plugin'
Require stack:
- /home/fewagner/git/graylog-project-repos/graylog-plugin-collector/webpack.config.js
- /home/fewagner/git/graylog-project-repos/graylog2-server/graylog2-web-interface/webpack.combined.config.ts
- /home/fewagner/git/graylog-project-repos/graylog2-server/graylog2-web-interface/webpack.bundled.ts
- /home/fewagner/git/graylog-project-repos/graylog2-server/graylog2-web-interface/node_modules/webpack-cli/lib/webpack-cli.js
- /home/fewagner/git/graylog-project-repos/graylog2-server/graylog2-web-interface/node_modules/webpack-cli/lib/bootstrap.js
- /home/fewagner/git/graylog-project-repos/graylog2-server/graylog2-web-interface/node_modules/webpack-cli/bin/cli.js
- /home/fewagner/git/graylog-project-repos/graylog2-server/graylog2-web-interface/node_modules/webpack/bin/webpack.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/home/fewagner/git/graylog-project-repos/graylog2-server/graylog2-web-interface/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
at Function.Module._load (node:internal/modules/cjs/loader:922:27)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at require (node:internal/modules/cjs/helpers:119:18)
at Object.<anonymous> (/home/fewagner/git/graylog-project-repos/graylog-plugin-collector/webpack.config.js:17:29)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Object.require.extensions.<computed> [as .js] (/home/fewagner/git/graylog-project-repos/graylog2-server/graylog2-web-interface/node_modules/ts-node/src/index.ts:1608:43)
at Module.load (node:internal/modules/cjs/loader:1119:32) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/fewagner/git/graylog-project-repos/graylog-plugin-collector/webpack.config.js',
'/home/fewagner/git/graylog-project-repos/graylog2-server/graylog2-web-interface/webpack.combined.config.ts',
'/home/fewagner/git/graylog-project-repos/graylog2-server/graylog2-web-interface/webpack.bundled.ts',
'/home/fewagner/git/graylog-project-repos/graylog2-server/graylog2-web-interface/node_modules/webpack-cli/lib/webpack-cli.js',
'/home/fewagner/git/graylog-project-repos/graylog2-server/graylog2-web-interface/node_modules/webpack-cli/lib/bootstrap.js',
'/home/fewagner/git/graylog-project-repos/graylog2-server/graylog2-web-interface/node_modules/webpack-cli/bin/cli.js',
'/home/fewagner/git/graylog-project-repos/graylog2-server/graylog2-web-interface/node_modules/webpack/bin/webpack.js'
]
}
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I suppose I should run these commands to have a hot reload web interface as compiling the plugin to the jar every time I change something is probably not the desired environment for working on web plugins for Graylog.
If any of you have an idea where that error is coming from, other ways to successfully work on Graylog plugins or if I’m on the wrong track entirely, I appreaciate every help.
Best regards