Skip to content
general purpose logstash client with multiple transports (logging library independent)
Branch: master
Clone or download
Latest commit 676605e Sep 29, 2016
Type Name Latest commit message Commit time
Failed to load latest commit information.
example initial release Aug 24, 2014
lib Add option to restrict queue size Jun 11, 2016
test Add option to restrict queue size Jun 11, 2016
.eslintrc initial release Aug 24, 2014
.travis.yml Add coveralls badge Aug 24, 2014 Add option to restrict queue size Jun 11, 2016
index.js initial release Aug 24, 2014
package.json 1.1.1 Sep 29, 2016

logstash-client Build Status Coverage Status

General purpose logstash with multiple transport support


  • tcp uses juliangruber's reconnect-net for handling reconnection
  • logging library independent (there are some logstash clients for winston, bunyan etc)


  • TCP Transport
  • UDP Transport
  • Memory Transport (for testing)
  • AMQP Transport
  • Codec support


var Logstash = require('logstash-client');

var logstash = new Logstash({
  type: 'udp', // udp, tcp, memory
  host: '',
  port: 13333
logstash.send(message [, callback]);



Takes the following parameters:

  • type: type of connection, currently supported tcp, udp, memory
  • host: remote hostname
  • port: remote port
  • format (optional): formatter function (by default the message gets JSON.stringified)
  • maxQueueSize (optional): Restricts the amount of messages queued when there is no connection. If not specified the queue is not limited in size.


new Client({
  type: 'tcp',
  host: '',
  port: 8099,
  format: function(message) {
    message.formattedAt = new Date();
    message.password = '!FILTERED!';
    return JSON.stringify(message, null, 2);
  maxQueueSize: 1000


Takes the following parameters:

  • message: an object what you are trying to send to your logstash instance
  • callback (optional): a function called when the message has been sent


var client = new Client({
  type: 'tcp',
  host: '',
  port: 1337
  '@timestamp': new Date(),
  'message': 'Important',
  'level': 'error'



You can’t perform that action at this time.