Remove GELF flag when capturing custom fields
* Logstash (which supports GELF) drops messages with this key * There's no particular need to keep this key
This commit is contained in:
@@ -85,6 +85,8 @@ function gelfAppender (layout, host, port, hostname, facility) {
|
||||
var firstData = data[0];
|
||||
|
||||
if (!firstData.GELF) return; // identify with GELF field defined
|
||||
// Remove the GELF key, some gelf supported logging systems drop the message with it
|
||||
delete firstData.GELF;
|
||||
Object.keys(firstData).forEach(function(key) {
|
||||
// skip _id field for graylog2, skip keys not starts with UNDERSCORE
|
||||
if (key.match(/^_/) || key !== "_id") {
|
||||
|
||||
Reference in New Issue
Block a user