GithubHelp home page GithubHelp logo

vercel / syslogpro Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cyamato/syslogpro

9.0 3.0 4.0 995 KB

A NodeJS Syslog module with support for RFC3164, RFC5424, LEEF, and CEF formatted messages over UDP, TCP or TLS transport

License: MIT License

JavaScript 22.95% HTML 0.24% TypeScript 76.80%

syslogpro's Introduction

SyslogPro

Build Status Coverage Status

Site | Docs | Wiki | Code of Conduct

A pure Javascript Syslog module with support for RFC3164, RFC5424, IBM LEEF (Log Event Extended Format), and HP CEF (Common Event Format) formatted messages. SyslogPro has transport options for UDP, TCP, and TLS. TLS includes support for Server and Client certificate authorization. For unformatted and RFC messages there is support for Basic and Extended ANSI coloring. RFC5424 Structured Data is also included in the module. All 28 standard CEF Extensions are included in the default CEF class. All 45 standard LEEF Attributes are included in the default LEEF class. It is the goal of this project is for every release to offer full code coverage unit testing and documentation.

Please see the full JSDoc for usage and options: https://cyamato.github.io/SyslogPro/.

News

Installation

  npm install --save syslog-pro

Usage

  const SyslogPro = require('syslog-pro');
  let syslog = new SyslogPro.Syslog({
    target: 'localhost',
    protocol: 'udp',
    format: 'rfc5424'
  });
  syslog.rfc5424.info('My Message');

Optionally you can create each class or class options to pass to SyslogPro to create formatted messages or use directly

RFC3164

  let rfc3164 = new SyslogPro.RFC3164({
    applicationName: 'MyApp',
    color: true,
    extendedColor: true,
    server: {
      target: 'myServer.fqdn'
    }
  });
  rfc3164.info('My Message');

RFC5424

  let rfc5424 = new SyslogPro.RFC5424({
    applicationName: 'MyApp',
    timestamp: true,
    includeStructuredData: true
    color: true,
    extendedColor: true,
    server: {
      target: 'myServer.fqdn'
    }
  });
  rfc5424.info('My Message');

LEEF (Log Event Extended Format)

  let leef = new SyslogPro.LEEF({
    vendor: 'acme',
    product: 'doohickey1000',
    version: 'alpha',
    eventId: 'hack',
    attrabutes: {
      cat: 'CC Databreach'
    },
    server: {
      target: 'myServer.fqdn'
    }
  })
      .send()
          .then((result) => {})
          .catch((error) => {
            console.log(error);
          });

CEF (Common Event Format)

  let cef = new SyslogPro.CEF({
    deviceVendor: 'acme',
    deviceProduct: 'doohickey1000',
    deviceVersion: 'alpha',
    deviceEventClassId: 'hack',
    name: 'My Reporting Service',
    severity: 'High',
    extensions: {
      rawEvent: 'CC Databreach'
    },
    server: {
      target: 'myServer.fqdn'
    }
  })
      .send()
          .then((result) => {})
          .catch((error) => {
            console.log(error);
          });

API

For more details see:

Test

  npm test

Contributing

Please try to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

syslogpro's People

Contributors

ajimix avatar cyamato avatar nkzawa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.