1.2.3 • Published 9 years ago

simple-udp-stream v1.2.3

Weekly downloads
535
License
MIT
Repository
github
Last release
9 years ago

simple-udp-stream

build dependencies npm version

Basic usage

var SimpleUdpStream = require('simple-udp-stream');

var stream = new SimpleUdpStream({
  destination: '127.0.0.1',
  port: 9999
});

stream.write("Hello World!");

stream.end();

wireshark simple capture

Bunyan and logstash

Configure logstash to listen to UDP logs:

input {
  udp {
     port => 9999
     codec => json
  }
}
output {
  elasticsearch {
    host => localhost
    protocol => http
  }
}

Configure bunyan to log over UDP:

var bunyan = require('bunyan');

var udpStream = require('simple-udp-stream')({
  destination: '127.0.0.1',
  port: 9999
});

var logger = bunyan.createLogger({
  name: 'my-logger',
  streams: [{
    level: 'info',
    stream: udpStream
  }]
});

logger.info({ value: 1 }, "Hello World!");

udpStream.end();

kibana capture

wireshark bunyan capture

Limitations

IPv4 only for now. Open a GitHub issue if you need IPv6 support.

Message size is limited by the smallest MTU between source and destination: see Node.js documentation.

If a message is too big, it will simply be dropped...

1.2.3

9 years ago

1.2.2

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago