graygelf
graygelf copied to clipboard
Pass remote.address and remote.port to emitted message
On the server side it would be interesting to know from where the packets arrive. The UDP socket provides this details, but the message processing ignores this info.
GELF requires host to be set in the message, but I suppose that could be set improperly by the client, and likely wouldn't include the port. You can sniff those details by adding your own event handler currently, e.g.
var gelfserver = require('graygelf/server')
var server = gelfserver()
server.on('message', function (gelf) {
// handle parsed gelf json here
console.log('received message', gelf.short_message)
})
server.listen(12201)
server._udp.on('message', function (buf, rinfo) {
// view raw packet info here
console.log(rinfo)
}