There seems to be an issue with the documentation instructions for custom plugins
It says:
In the plugin code, you can reference base plugins with var base_filter = require('lib/base_filter');
Unfortunately you cannot do that because base_filter.js requires './base_component' and it will not be found as a relative file to your /var/my_plugins/filters or /var/db/node-logstash/custom_plugins/filters
For example if you try to require('lib/base_filter_buffer'), base_filter_buffer will be required because it exists in NODE_PATH but you will get the following error because base_filter_buffer extends base_filter
ERROR Error: Cannot find module './base_filter'
As a temporary solution, I am deploying my custom filters to /opt/node-logstash/lib/filters/ but it would be nice if you can correct this or find a better solution
Hello,
There seems to be an issue with the documentation instructions for custom plugins
It says: In the plugin code, you can reference base plugins with var base_filter = require('lib/base_filter');
Unfortunately you cannot do that because base_filter.js requires './base_component' and it will not be found as a relative file to your /var/my_plugins/filters or /var/db/node-logstash/custom_plugins/filters
For example if you try to require('lib/base_filter_buffer'), base_filter_buffer will be required because it exists in NODE_PATH but you will get the following error because base_filter_buffer extends base_filter
ERROR Error: Cannot find module './base_filter'
As a temporary solution, I am deploying my custom filters to /opt/node-logstash/lib/filters/ but it would be nice if you can correct this or find a better solution