SyslogPro
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
- ⚠ Please note that at present, the 1.x.x version of the SDK requires Node 10.6 or later.
- This module makes use of ECMA-262 Promise and the DNS Promises API.
- APIs do not support the callback model and only return promises.
Installation
npm install --save syslog-pro
Usage
const SyslogPro = ; let syslog = target: 'localhost' protocol: 'udp' format: 'rfc5424' ; syslogrfc5424;
Optionally you can create each class or class options to pass to SyslogPro to create formatted messages or use directly
RFC3164
let rfc3164 = applacationName: 'MyApp' color: true extendedColor: true server: target: 'myServer.fqdn' ; rfc3164;
RFC5424
let rfc5424 = applacationName: 'MyApp' timestamp: true encludeStructuredData: true color: true extendedColor: true server: target: 'myServer.fqdn' ; rfc5424;
LEEF (Log Event Extended Format)
let leef = vendor: 'acme' product: 'doohickey1000' version: 'alpha' eventId: 'hack' attrabutes: cat: 'CC Databreach' server: target: 'myServer.fqdn' ;
CEF (Common Event Format)
let cef = deviceVendor: 'acme' deviceProduct: 'doohickey1000' deviceVersion: 'alpha' deviceEventClassId: 'hack' name: 'My Reporting Service' severity: 'High' extensions: rawEvent: 'CC Databreach' server: target: 'myServer.fqdn' ;
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.