Git Product home page Git Product logo

hapi-good-logstash's Introduction

Logstash reporter for good

A good reporter to communicate directly with a logstash instance using the lumberjack-protocol client

Install

npm install --save hapi-good-logstash

Usage

Example for sending all ops events to logstash

connection.register({
    register: require('good'),
    options: {
      opsInterval: 15000,
        reporters: [{
          reporter: require("hapi-good-logstash"),
          args: [{
              ops: '*'
          }, {
              tlsOptions: {
                  host: "localhost",
                  port: 8001,
                  ca: [fs.readFileSync('path to .crt')],
                  key: [fs.readFileSync('path to .key')],
                  cert: [fs.readFileSync('path to .crt')]
              },
              clientOptions: {
                  maxQueueSize: 500
              }
          }]
      }]
    } 
}, function (err) {
    if (err) {
        console.log('Failed loading good plugin', err);
    }
});

The clientoptions are passed to the lumberjack-protocol module and the tlsOptions are passed to the node.js tls socket connection directly.

Security

We use a patched version of logstash and the lumberjack input, which only accepts ssl certificates configured in the logstash config, so the socket connection will be reset, if you provide a wrong certificate. This is unfortunately not the default behavior of the official Logstash release. The official logstash package accepts inputs even if provided a completley different certificate.

We published a blog post with a guide how to use our patched setup on our homepages tech section.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.