Skip to main content

I’m writing a custom function and I’m able to add it to a pipeline. However, when I try to process an event, I get an error.

Here’s the content of my index.js:

exports.name = ‘MyCustomFunction’;
exports.group = ‘Custom Functions’;
exports.version = 0.1;

exports.init = (opts) => {
const conf = opts.conf || {};
};

exports.process = (event) => {
return event; // noop
};

I’m unable to find where, if any, error messages are written to the logs. I looked at the logs under Monitoring (Logs tab) and docker logs with no success.

Are errors of this type written anywhere?

I think we are saying the same thing, in code.

I discovered my issue. While developing the function. Something was in an "invalid state". I was able to correct the issue by deleting/removing values in my function and redefining.

Thanks for the pointer to the "Preview Log".


You are trying to reference events before it has been defined.

Im not an expert on JS so this may not be the most optimal but it does work:

let name = 'MyCustomFunction';let group = 'Custom Functions';let version = 0.1;const exports = { name: name, group: group, version: version };exports.init = (opts) => {const conf = opts.conf || {};};exports.process = (event) => {return event; // noop};

As far as where to find the errors, when previewing your data click the Gear button below the Run button, as shown in the image, then choose Preview Log.

124_7f1643c36c8e401d9220a65f0550df42.png

Reply