npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@techteamer/syslog-pro

v0.3.1

Published

A Syslog client which options for UDP, TCP, and TLS transport and suport for both RFC-3164 and RFC-5424 including Structured Data.

Downloads

343

Readme

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',
    attributes: {
      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.