I'm using this for bunyan logging stream, via #forBunyan.
Is there a way to filter out only certain messages to be sent to graylog?
I tried it with options.filter, like this:
gelfStream.forBunyan(config.graylogHost, config.graylogPort, {
filter: function filter(chunk) {
console.log('**** in gelf stream #filter ****');
return false; // or some arbitrary decision, based on `chunk`
}
});
I'm using this for bunyan logging stream, via
#forBunyan
. Is there a way to filter out only certain messages to be sent to graylog?I tried it with
options.filter
, like this:But, the first time the
filter
function returnsfalse
, no other message/chunk is ever sent to graylog. The idea is based on https://github.com/mhart/gelf-stream/blob/master/gelf-stream.js#L29, but I am probably missing something here.Anyway, any pointer to to how to filter out / send only desired messages would be great. Thank you!