diff --git a/README.md b/README.md index 4c2dba9..3674daf 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,8 @@ and the [DNS Promises API](https://nodejs.org/api/dns.html#dns_dns_promises_api) }); syslog.rfc5424.info('My Message'); ``` - Optionaly you can create each class or class options to pass to SyslogPro - to create formated messages or use directly +Optionally you can create each class or class options to pass to SyslogPro to +create formatted messages or use directly **RFC3164** ```js diff --git a/docs/api.md b/docs/api.md index f96c87e..d6117bd 100644 --- a/docs/api.md +++ b/docs/api.md @@ -13,10 +13,10 @@ The SyslogPro module for sending syslog messages Most APIs will return a promise. These APIs can be used using `then(...)/catch(...)` -Syslog formating classes can be used as input into a Syslog class to be used -simultatniusly to the same Syslog server. The Syslog Class with a configured -Syslog server target can also be used as the input into each of the formating -classes so that they may run independtly. +Syslog formatting classes can be used as input into a Syslog class to be used +simultaneously to the same Syslog server. The Syslog Class with a configured +Syslog server target can also be used as the input into each of the formatting +classes so that they may run independently. **Version**: 0.1.0 **Author**: Craig Yamato @@ -94,7 +94,7 @@ classes so that they may run independtly. * [.version](#module_SyslogPro..LEEF+version) : string * [.eventId](#module_SyslogPro..LEEF+eventId) : string * [.syslogHeader](#module_SyslogPro..LEEF+syslogHeader) : boolean - * [.attrabutes](#module_SyslogPro..LEEF+attrabutes) : object + * [.attributes](#module_SyslogPro..LEEF+attributes) : object * [.buildMessage()](#module_SyslogPro..LEEF+buildMessage) ⇒ Promise * [.send([options])](#module_SyslogPro..LEEF+send) * [~CEF](#module_SyslogPro..CEF) @@ -114,11 +114,11 @@ classes so that they may run independtly. ### SyslogPro~Syslog A class to work with syslog messages using UDP, TCP, or TLS transport. -There is suport for Syslog message formating RFC-3164, RFC-5424 including +There is support for Syslog message formatting RFC-3164, RFC-5424 including Structured Data, IBM LEEF (Log Event Extended Format), and HP CEF (Common Event Format). -Syslog formating classes can be used as input into a Syslog class to be used -simultatniusly to the same Syslog server. * +Syslog formatting classes can be used as input into a Syslog class to be used +simultaneously to the same Syslog server. * **Kind**: inner class of [SyslogPro](#module_SyslogPro) **Requires**: module:moment @@ -148,19 +148,19 @@ Construct a new Syslog transport object with user options | Param | Type | Default | Description | | --- | --- | --- | --- | -| [options] | object | | Options object >>>Transport Configuraton | -| [options.target] | string | "'localhost'" | The IP Address|FQDN of the Syslog Server, this option if set will take prasdents over any target set in a formating object | -| [options.protocol] | string | "'udp'" | L4 transport portocol (udp|tcp|tls), this option if set will take prasdents over any transport set in a formating object | -| [options.port] | number | 514 | IP port, this option if set will take prasdents over any IP Port set in a formating object | -| [options.tcpTimeout] | number | 10000 | Ignored for all other transports, this option if set will take prasdents over any timeout set in a formating object | -| [options.tlsServerCerts] | Array.<string> | | Array of authrized TLS server certificates file locations, this option if set will take prasdents over any certificates set in a formating object | -| [options.tlsClientCert] | string | | Client TLS certificate file location that this client should use, this option if set will take prasdents over any certificates set in a formating object | -| [options.tlsClientKey] | string | | Client TLS key file location that this client should use, this option if set will take prasdents over any certificates set in a formating object >>>Syslog Format Settings | +| [options] | object | | Options object >>>Transport Configuration | +| [options.target] | string | "'localhost'" | The IP Address|FQDN of the Syslog Server, this option if set will take presidents over any target set in a formatting object | +| [options.protocol] | string | "'udp'" | L4 transport protocol (udp|tcp|tls), this option if set will take presidents over any transport set in a formatting object | +| [options.port] | number | 514 | IP port, this option if set will take presidents over any IP Port set in a formatting object | +| [options.tcpTimeout] | number | 10000 | Ignored for all other transports, this option if set will take presidents over any timeout set in a formatting object | +| [options.tlsServerCerts] | Array.<string> | | Array of authorized TLS server certificates file locations, this option if set will take presidents over any certificates set in a formatting object | +| [options.tlsClientCert] | string | | Client TLS certificate file location that this client should use, this option if set will take presidents over any certificates set in a formatting object | +| [options.tlsClientKey] | string | | Client TLS key file location that this client should use, this option if set will take presidents over any certificates set in a formatting object >>>Syslog Format Settings | | [options.format] | string | "'none'" | Valid syslog format options for this module are 'none', 'rfc3164', 'rfc5424', 'leef', 'cef' | | [options.rfc5424] | RFC3164 | | {@link module:SyslogPro~RFC5424| RFC5424 related settings} | | [options.rfc5424] | RFC5424 | | {@link module:SyslogPro~RFC5424| RFC5424 related settings} | | [options.leef] | LEEF | | {@link module:SyslogPro~LEEF|IBM LEEF (Log Event Extended Format) object} | -| [options.cef] | CEF | | {@link module:SyslogPro~CEF|HP CEF (Common Event Format) formating object} | +| [options.cef] | CEF | | {@link module:SyslogPro~CEF|HP CEF (Common Event Format) formatting object} | @@ -213,18 +213,18 @@ Construct a new Syslog transport object with user options ### SyslogPro~RFC3164 -A class to work with RFC3164 formated syslog messages. The meesaging is fully configurabule and Ansi foreground -colors can be added. Both ANSI 8 and ANSI 256 color are fully suported. +A class to work with RFC3164 formatted syslog messages. The messaging is fully configurable and ANSI foreground +colors can be added. Both ANSI 8 and ANSI 256 color are fully supported. Most APIs will return a promise. These APIs can be used using `then(...)/catch(...)` A Syslog class with a configured -Syslog server target can also be used as the input into the formating -classes so that it may run independtly. +Syslog server target can also be used as the input into the formatting +classes so that it may run independently. -The RFC3164 Syslog logging format is ment to be used as a stream of log data -from a service or applacation. This class is designed to be used in this -fashion where new messages are writen to the class as needed. +The RFC3164 Syslog logging format is meant to be used as a stream of log data +from a service or application. This class is designed to be used in this +fashion where new messages are written to the class as needed. **Kind**: inner class of [SyslogPro](#module_SyslogPro) **Requires**: module:moment @@ -257,18 +257,18 @@ fashion where new messages are writen to the class as needed. #### new RFC3164([options]) -Construct a new RFC3164 formated Syslog object with user options +Construct a new RFC3164 formatted Syslog object with user options | Param | Type | Default | Description | | --- | --- | --- | --- | | [options] | object | | Options object | -| [options.applacationName] | string | "'NodeJSLogger'" | Applacation | +| [options.applacationName] | string | "'NodeJSLogger'" | Application | | [options.hostname] | string | "os.hostname" | The name of this server | | [options.facility] | number | 23 | Facility code to use sending this message | | [options.color] | boolean | false | Apply color coding encoding tag with syslog message text | -| [options.extendedColor] | boolean | false | Use the extedned ANSI color set encoding tag with syslog message text | -| [options.colors] | object | | User defended colors for severites | +| [options.extendedColor] | boolean | false | Use the extended ANSI color set encoding tag with syslog message text | +| [options.colors] | object | | User defended colors for severities | | [options.colors.emergencyColor] | string | | A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | | [options.colors.alertColor] | string | | A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | | [options.colors.criticalColor] | string | | A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | @@ -313,10 +313,10 @@ Sets the color to be used for messages at a set priority #### rfC3164.buildMessage(msg, [options]) ⇒ Promise -Building a formated message. Returns a promise with a formated message +Building a formatted message. Returns a promise with a formatted message **Kind**: instance method of [RFC3164](#module_SyslogPro..RFC3164) -**Returns**: Promise - A Syslog formated string acording to the selected RFC +**Returns**: Promise - A Syslog formatted string according to the selected RFC **Throws**: - Error A standard error object @@ -333,12 +333,12 @@ Building a formated message. Returns a promise with a formated message #### rfC3164.send(msg, [options]) ⇒ Promise -send a RFC5424 formated message. Returns a promise with the formated +send a RFC5424 formatted message. Returns a promise with the formatted message that was sent. If no server connection was defined when the - class was created a defualt Syslog connector will be used. + class was created a default Syslog connector will be used. **Kind**: instance method of [RFC3164](#module_SyslogPro..RFC3164) -**Returns**: Promise - A Syslog formated string acording to the selected RFC +**Returns**: Promise - A Syslog formatted string according to the selected RFC **Throws**: - Error A standard error object @@ -348,7 +348,7 @@ send a RFC5424 formated message. Returns a promise with the formated | Param | Type | Default | Description | | --- | --- | --- | --- | -| msg | string | | The unformated Syslog message to send | +| msg | string | | The unformatted Syslog message to send | | [options] | object | | Options object | | [options.severity] | number | 7 | An array of structure | | [options.colorCode] | number | 36 | The ANSI color code to use if | @@ -356,47 +356,47 @@ send a RFC5424 formated message. Returns a promise with the formated #### rfC3164.emergency(msg) ⇒ Promise -Send a syslog message with a secerity level of 0 (Emergency) +Send a syslog message with a security level of 0 (Emergency) **Kind**: instance method of [RFC3164](#module_SyslogPro..RFC3164) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public | Param | Type | Description | | --- | --- | --- | -| msg | string | The emergancy message to send to the Syslog server | +| msg | string | The emergency message to send to the Syslog server | #### rfC3164.emer(msg) ⇒ Promise -Send a syslog message with a secerity level of 0 (Emergency) +Send a syslog message with a security level of 0 (Emergency) **Kind**: instance method of [RFC3164](#module_SyslogPro..RFC3164) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public | Param | Type | Description | | --- | --- | --- | -| msg | string | The emergancy message to send to the Syslog server | +| msg | string | The emergency message to send to the Syslog server | #### rfC3164.alert(msg) ⇒ Promise -Send a syslog message with a secerity level of 1 (Alert) +Send a syslog message with a severity level of 1 (Alert) **Kind**: instance method of [RFC3164](#module_SyslogPro..RFC3164) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -407,13 +407,13 @@ Send a syslog message with a secerity level of 1 (Alert) #### rfC3164.critical(msg) ⇒ Promise -Send a syslog message with a secerity level of 2 (Critical) +Send a syslog message with a severity level of 2 (Critical) **Kind**: instance method of [RFC3164](#module_SyslogPro..RFC3164) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -424,13 +424,13 @@ Send a syslog message with a secerity level of 2 (Critical) #### rfC3164.crit(msg) ⇒ Promise -Send a syslog message with a secerity level of 2 (Critical) +Send a syslog message with a severity level of 2 (Critical) **Kind**: instance method of [RFC3164](#module_SyslogPro..RFC3164) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -441,13 +441,13 @@ Send a syslog message with a secerity level of 2 (Critical) #### rfC3164.error(msg) ⇒ Promise -Send a syslog message with a secerity level of 3 (Error) +Send a syslog message with a severity level of 3 (Error) **Kind**: instance method of [RFC3164](#module_SyslogPro..RFC3164) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -458,13 +458,13 @@ Send a syslog message with a secerity level of 3 (Error) #### rfC3164.err(msg) ⇒ Promise -Send a syslog message with a secerity level of 3 (Error) +Send a syslog message with a severity level of 3 (Error) **Kind**: instance method of [RFC3164](#module_SyslogPro..RFC3164) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -475,13 +475,13 @@ Send a syslog message with a secerity level of 3 (Error) #### rfC3164.warning(msg) ⇒ Promise -Send a syslog message with a secerity level of 4 (Warning) +Send a syslog message with a severity level of 4 (Warning) **Kind**: instance method of [RFC3164](#module_SyslogPro..RFC3164) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -492,13 +492,13 @@ Send a syslog message with a secerity level of 4 (Warning) #### rfC3164.warn(msg) ⇒ Promise -Send a syslog message with a secerity level of 4 (Warning) +Send a syslog message with a severity level of 4 (Warning) **Kind**: instance method of [RFC3164](#module_SyslogPro..RFC3164) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -509,13 +509,13 @@ Send a syslog message with a secerity level of 4 (Warning) #### rfC3164.notice(msg) ⇒ Promise -Send a syslog message with a secerity level of 5 (Notice) +Send a syslog message with a severity level of 5 (Notice) **Kind**: instance method of [RFC3164](#module_SyslogPro..RFC3164) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -526,13 +526,13 @@ Send a syslog message with a secerity level of 5 (Notice) #### rfC3164.note(msg) ⇒ Promise -Send a syslog message with a secerity level of 5 (Notice) +Send a syslog message with a severity level of 5 (Notice) **Kind**: instance method of [RFC3164](#module_SyslogPro..RFC3164) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -543,13 +543,13 @@ Send a syslog message with a secerity level of 5 (Notice) #### rfC3164.informational(msg) ⇒ Promise -Send a syslog message with a secerity level of 6 (Informational) +Send a syslog message with a severity level of 6 (Informational) **Kind**: instance method of [RFC3164](#module_SyslogPro..RFC3164) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -560,13 +560,13 @@ Send a syslog message with a secerity level of 6 (Informational) #### rfC3164.info(msg) ⇒ Promise -Send a syslog message with a secerity level of 6 (Informational) +Send a syslog message with a severity level of 6 (Informational) **Kind**: instance method of [RFC3164](#module_SyslogPro..RFC3164) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -577,13 +577,13 @@ Send a syslog message with a secerity level of 6 (Informational) #### rfC3164.log(msg) ⇒ Promise -Send a syslog message with a secerity level of 6 (Informational) +Send a syslog message with a severity level of 6 (Informational) **Kind**: instance method of [RFC3164](#module_SyslogPro..RFC3164) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -594,13 +594,13 @@ Send a syslog message with a secerity level of 6 (Informational) #### rfC3164.debug(msg) ⇒ Promise -Send a syslog message with a secerity level of 7 (Debug) +Send a syslog message with a severity level of 7 (Debug) **Kind**: instance method of [RFC3164](#module_SyslogPro..RFC3164) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -611,18 +611,18 @@ Send a syslog message with a secerity level of 7 (Debug) ### SyslogPro~RFC5424 -A class to work with RFC5424 formated syslog messages. The meesaging is fully configurabule and Ansi foreground -colors can be added. Both ANSI 8 and ANSI 256 color are fully suported. +A class to work with RFC5424 formatted syslog messages. The messaging is fully configurable and ANSI foreground +colors can be added. Both ANSI 8 and ANSI 256 color are fully supported. Most APIs will return a promise. These APIs can be used using `then(...)/catch(...)` A Syslog class with a configured -Syslog server target can also be used as the input into the formating -classes so that it may run independtly. +Syslog server target can also be used as the input into the formatting +classes so that it may run independently. -The RFC5424 Syslog logging format is ment to be used as a stream of log data -from a service or applacation. This class is designed to be used in this -fashion where new messages are writen to the class as needed. +The RFC5424 Syslog logging format is meant to be used as a stream of log data +from a service or application. This class is designed to be used in this +fashion where new messages are written to the class as needed. **Kind**: inner class of [SyslogPro](#module_SyslogPro) **Requires**: module:moment @@ -661,23 +661,23 @@ fashion where new messages are writen to the class as needed. #### new RFC5424([options]) -Construct a new RFC5424 formated Syslog object with user options +Construct a new RFC5424 formatted Syslog object with user options | Param | Type | Default | Description | | --- | --- | --- | --- | | [options] | object | | Options object | -| [options.applacationName] | string | "'NodeJSLogger'" | Applacation | +| [options.applacationName] | string | "'NodeJSLogger'" | Application | | [options.hostname] | string | "os.hostname" | The name of this server | | [options.timestamp] | boolean | false | Included a Timestamp | -| [options.timestampUTC] | boolean | false | RFC tandard is for local time | -| [options.timestampMS] | boolean | false | Timestamp with ms resoltuion | -| [options.timestampTZ] | boolean | true | Should the timestamp included timezone | +| [options.timestampUTC] | boolean | false | RFC standard is for local time | +| [options.timestampMS] | boolean | false | Timestamp with ms resolution | +| [options.timestampTZ] | boolean | true | Should the timestamp included time zone | | [options.encludeStructuredData] | boolean | false | Included any provided structured data | | [options.utf8BOM] | boolean | true | Included the UTF8 | | [options.color] | boolean | false | Included the UTF8 | | [options.extendedColor] | boolean | false | Included the UTF8 encoding tag with syslog message text | -| [options.colors] | object | | User defended colors for severites | +| [options.colors] | object | | User defended colors for severities | | [options.colors.emergencyColor] | string | | A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | | [options.colors.alertColor] | string | | A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | | [options.colors.criticalColor] | string | | A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | @@ -746,10 +746,10 @@ Sets the color to be used for messages at a set priority #### rfC5424.buildMessage(msg, [options]) ⇒ Promise -Building a formated message. Returns a promise with a formated message +Building a formatted message. Returns a promise with a formatted message **Kind**: instance method of [RFC5424](#module_SyslogPro..RFC5424) -**Returns**: Promise - A Syslog formated string acording to the selected RFC +**Returns**: Promise - A Syslog formatted string according to the selected RFC **Throws**: - Error A standard error object @@ -763,18 +763,18 @@ Building a formated message. Returns a promise with a formated message | [options.severity] | number | 7 | An array of structure | | [options.facility] | number | 23 | Facility code to use sending this message | | [options.pid] | string | "'-'" | The process id of the service sending this message | -| [options.structuredData] | Array.<string> | | An array of structure data strings conforming to the IETF/IANA defined SD-IDs or IANA registred SMI Network Management Private Enterprise Code SD-ID conforming to the format [name@ parameter=value] | +| [options.structuredData] | Array.<string> | | An array of structure data strings conforming to the IETF/IANA defined SD-IDs or IANA registered SMI Network Management Private Enterprise Code SD-ID conforming to the format [name@ parameter=value] | | [options.colorCode] | number | 36 | The ANSI color code to use if message coloration is selected | #### rfC5424.send(msg) ⇒ Promise -send a RFC5424 formated message. Returns a promise with the formated +send a RFC5424 formatted message. Returns a promise with the formatted message that was sent. If no server connection was defined when the - class was created a defualt Syslog connector will be used. + class was created a default Syslog connector will be used. **Kind**: instance method of [RFC5424](#module_SyslogPro..RFC5424) -**Returns**: Promise - A Syslog formated string acording to the selected RFC +**Returns**: Promise - A Syslog formatted string according to the selected RFC **Throws**: - Error A standard error object @@ -784,52 +784,52 @@ send a RFC5424 formated message. Returns a promise with the formated | Param | Type | Description | | --- | --- | --- | -| msg | string | The unformated Syslog message to send | +| msg | string | The unformatted Syslog message to send | #### rfC5424.emergency(msg) ⇒ Promise -Send a syslog message with a secerity level of 0 (Emergency) +Send a syslog message with a severity level of 0 (Emergency) **Kind**: instance method of [RFC5424](#module_SyslogPro..RFC5424) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public | Param | Type | Description | | --- | --- | --- | -| msg | string | The emergancy message to send to the Syslog server | +| msg | string | The emergency message to send to the Syslog server | #### rfC5424.emer(msg) ⇒ Promise -Send a syslog message with a secerity level of 0 (Emergency) +Send a syslog message with a severity level of 0 (Emergency) **Kind**: instance method of [RFC5424](#module_SyslogPro..RFC5424) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public | Param | Type | Description | | --- | --- | --- | -| msg | string | The emergancy message to send to the Syslog server | +| msg | string | The emergency message to send to the Syslog server | #### rfC5424.alert(msg) ⇒ Promise -Send a syslog message with a secerity level of 1 (Alert) +Send a syslog message with a severity level of 1 (Alert) **Kind**: instance method of [RFC5424](#module_SyslogPro..RFC5424) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -840,13 +840,13 @@ Send a syslog message with a secerity level of 1 (Alert) #### rfC5424.critical(msg) ⇒ Promise -Send a syslog message with a secerity level of 2 (Critical) +Send a syslog message with a severity level of 2 (Critical) **Kind**: instance method of [RFC5424](#module_SyslogPro..RFC5424) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -857,13 +857,13 @@ Send a syslog message with a secerity level of 2 (Critical) #### rfC5424.crit(msg) ⇒ Promise -Send a syslog message with a secerity level of 2 (Critical) +Send a syslog message with a severity level of 2 (Critical) **Kind**: instance method of [RFC5424](#module_SyslogPro..RFC5424) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -874,13 +874,13 @@ Send a syslog message with a secerity level of 2 (Critical) #### rfC5424.error(msg) ⇒ Promise -Send a syslog message with a secerity level of 3 (Error) +Send a syslog message with a severity level of 3 (Error) **Kind**: instance method of [RFC5424](#module_SyslogPro..RFC5424) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -891,13 +891,13 @@ Send a syslog message with a secerity level of 3 (Error) #### rfC5424.err(msg) ⇒ Promise -Send a syslog message with a secerity level of 3 (Error) +Send a syslog message with a severity level of 3 (Error) **Kind**: instance method of [RFC5424](#module_SyslogPro..RFC5424) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -908,13 +908,13 @@ Send a syslog message with a secerity level of 3 (Error) #### rfC5424.warning(msg) ⇒ Promise -Send a syslog message with a secerity level of 4 (Warning) +Send a syslog message with a severity level of 4 (Warning) **Kind**: instance method of [RFC5424](#module_SyslogPro..RFC5424) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -925,13 +925,13 @@ Send a syslog message with a secerity level of 4 (Warning) #### rfC5424.warn(msg) ⇒ Promise -Send a syslog message with a secerity level of 4 (Warning) +Send a syslog message with a severity level of 4 (Warning) **Kind**: instance method of [RFC5424](#module_SyslogPro..RFC5424) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -942,13 +942,13 @@ Send a syslog message with a secerity level of 4 (Warning) #### rfC5424.notice(msg) ⇒ Promise -Send a syslog message with a secerity level of 5 (Notice) +Send a syslog message with a severity level of 5 (Notice) **Kind**: instance method of [RFC5424](#module_SyslogPro..RFC5424) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -959,13 +959,13 @@ Send a syslog message with a secerity level of 5 (Notice) #### rfC5424.note(msg) ⇒ Promise -Send a syslog message with a secerity level of 5 (Notice) +Send a syslog message with a severity level of 5 (Notice) **Kind**: instance method of [RFC5424](#module_SyslogPro..RFC5424) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -976,13 +976,13 @@ Send a syslog message with a secerity level of 5 (Notice) #### rfC5424.informational(msg) ⇒ Promise -Send a syslog message with a secerity level of 6 (Informational) +Send a syslog message with a severity level of 6 (Informational) **Kind**: instance method of [RFC5424](#module_SyslogPro..RFC5424) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -993,13 +993,13 @@ Send a syslog message with a secerity level of 6 (Informational) #### rfC5424.info(msg) ⇒ Promise -Send a syslog message with a secerity level of 6 (Informational) +Send a syslog message with a severity level of 6 (Informational) **Kind**: instance method of [RFC5424](#module_SyslogPro..RFC5424) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -1010,13 +1010,13 @@ Send a syslog message with a secerity level of 6 (Informational) #### rfC5424.log(msg) ⇒ Promise -Send a syslog message with a secerity level of 6 (Informational) +Send a syslog message with a severity level of 6 (Informational) **Kind**: instance method of [RFC5424](#module_SyslogPro..RFC5424) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -1027,13 +1027,13 @@ Send a syslog message with a secerity level of 6 (Informational) #### rfC5424.debug(msg) ⇒ Promise -Send a syslog message with a secerity level of 7 (Debug) +Send a syslog message with a severity level of 7 (Debug) **Kind**: instance method of [RFC5424](#module_SyslogPro..RFC5424) -**Returns**: Promise - - The formated syslog message sent to the Syslog server +**Returns**: Promise - - The formatted syslog message sent to the Syslog server **Throws**: -- Error - Any bubbled up error +- Error - Any bubbled-up error **Access**: public @@ -1047,15 +1047,15 @@ Send a syslog message with a secerity level of 7 (Debug) A class to work with IBM LEEF (Log Event Extended Format) messages this form of system messages are designed to work with security systems. Messages can be saved to file (Saving to file if not part of this module but a LEEF -formated mesage produced by this module can be saved externaly to it) or +formatted message produced by this module can be saved externally to it) or sent via Syslog. Most APIs will return a promise. These APIs can be used using `then(...)/catch(...)` A Syslog class with a configured Syslog server target can also be used as -the input into the formating classes so that it may run independtly. The +the input into the formatting classes so that it may run independently. The LEEF format is designed to send event data to a SIEM system and should not -be as a logging stream. This class is ment to be used once per message. +be as a logging stream. This class is meant to be used once per message. **Kind**: inner class of [SyslogPro](#module_SyslogPro) **Requires**: module:moment @@ -1069,24 +1069,24 @@ be as a logging stream. This class is ment to be used once per message. * [.version](#module_SyslogPro..LEEF+version) : string * [.eventId](#module_SyslogPro..LEEF+eventId) : string * [.syslogHeader](#module_SyslogPro..LEEF+syslogHeader) : boolean - * [.attrabutes](#module_SyslogPro..LEEF+attrabutes) : object + * [.attributes](#module_SyslogPro..LEEF+attributes) : object * [.buildMessage()](#module_SyslogPro..LEEF+buildMessage) ⇒ Promise * [.send([options])](#module_SyslogPro..LEEF+send) #### new LEEF([options]) -Construct a new LEEF formating object with user options +Construct a new LEEF formatting object with user options | Param | Type | Default | Description | | --- | --- | --- | --- | | [options] | object | | Options object | -| [options.vendor] | string | "'unknown'" | The vendor of the system that genrated the event being reported | +| [options.vendor] | string | "'unknown'" | The vendor of the system that generated the event being reported | | [options.product] | string | "'unknown'" | The product name of the system that genrated the event being reported | | [options.version] | string | "'unknown'" | The version name of the system that genrated the event being reported | | [options.eventId] | string | "'unknown'" | The eventId of the system that genrated the event being reported | -| [options.attrabute] | object | | LEEF message attrabutes which defualts to all base attrabutes with null values, new attrabutes should be added as new elements to this object | +| [options.attributes] | object | | LEEF message attributes which defaults to all base attributes with null values, new attributes should be added as new elements to this object | | [options.syslogHeader] | boolean | 'true' | Should the LEEF message include a Syslog header with Timestamp and source | | [options.server] | Syslog | false | A {@link module:SyslogPro~Syslog| Syslog server connection} that should be used to send messages directly from this class. @see SyslogPro~Syslog | @@ -1110,17 +1110,17 @@ Construct a new LEEF formating object with user options #### leeF.syslogHeader : boolean **Kind**: instance property of [LEEF](#module_SyslogPro..LEEF) - + -#### leeF.attrabutes : object +#### leeF.attributes : object **Kind**: instance property of [LEEF](#module_SyslogPro..LEEF) #### leeF.buildMessage() ⇒ Promise -Build a formated message +Build a formatted message **Kind**: instance method of [LEEF](#module_SyslogPro..LEEF) -**Returns**: Promise - - string with formated message +**Returns**: Promise - - string with formatted message **Access**: public @@ -1138,15 +1138,15 @@ Build a formated message A class to work with HP CEF (Common Event Format) messages. This form of system messages are designed to work with security systems. Messages can be saved to file (Saving to file if not part of this module but a CEF -formated mesage produced by this module can be saved externaly to it) or +formatted message produced by this module can be saved externally to it) or sent via Syslog. Most APIs will return a promise. These APIs can be used using `then(...)/catch(...)` A Syslog class with a configured Syslog server target can also be used as -the input into the formating classes so that it may run independtly. The CEF +the input into the formatting classes so that it may run independently. The CEF format is designed to send event data to a SIEM system and should not be as -a logging stream. This class is ment to be used once per message. +a logging stream. This class is meant to be used once per message. **Kind**: inner class of [SyslogPro](#module_SyslogPro) **Requires**: module:moment @@ -1169,19 +1169,19 @@ a logging stream. This class is ment to be used once per message. #### new CEF([options]) -Construct a new CEF formating object with user options +Construct a new CEF formatting object with user options | Param | Type | Default | Description | | --- | --- | --- | --- | | [options] | object | | Options object | -| [options.deviceVendor] | string | "'unknown'" | The vendor of the system that genrated the event being reported | +| [options.deviceVendor] | string | "'unknown'" | The vendor of the system that generated the event being reported | | [options.deviceProduct] | string | "'unknown'" | The product name of the system that genrated the event being reported | | [options.deviceVersion] | string | "'unknown'" | The version name of the system that genrated the event being reported | | [options.deviceEventClassId] | string | "'unknown'" | The eventId of the system that genrated the event being reported | -| [options.name] | string | "'unknown'" | Name of the service genrating the notice | +| [options.name] | string | "'unknown'" | Name of the service generating the notice | | [options.severity] | string | "'unknown'" | Severity of the notification | -| [options.extensions] | string | "{}" | Any CEF Key=Value extentions | +| [options.extensions] | string | "{}" | Any CEF Key=Value extensions | | [options.server] | Syslog | false | A {@link module:SyslogPro~Syslog| Syslog server connection} that should be used to send messages directly from this class. @see SyslogPro~Syslog | @@ -1218,10 +1218,10 @@ Construct a new CEF formating object with user options Validate this CEF object **Kind**: instance method of [CEF](#module_SyslogPro..CEF) -**Returns**: Promise - - True if valadated +**Returns**: Promise - - True if validated **Throws**: -- Error - First element to fail valadation +- Error - First element to fail validation **Access**: public diff --git a/docs/docco/README.md b/docs/docco/README.md index 2b4032a..cbe21fb 100644 --- a/docs/docco/README.md +++ b/docs/docco/README.md @@ -2,6 +2,7 @@ +INDEX.JS @@ -14,10 +15,10 @@ * Most APIs will return a promise. These APIs can be used using * `then(...)/catch(...)` * - * Syslog formating classes can be used as input into a Syslog class to be used - * simultatniusly to the same Syslog server. The Syslog Class with a configured - * Syslog server target can also be used as the input into each of the formating - * classes so that they may run independtly. + * Syslog formatting classes can be used as input into a Syslog class to be used + * simultaneously to the same Syslog server. The Syslog Class with a configured + * Syslog server target can also be used as the input into each of the formatting + * classes so that they may run independently. * @author Craig Yamato * @copyright (c) 2018 - Craig Yamato * @version 0.1.0 @@ -38,7 +39,7 @@ const fs = require("fs"); * @private * @param {string} hex - The color hex code in the form of #FFFFFF or Number of * the ANSI color code (30-37 Standard & 0-255 Extended) - * @returns {Promise} - The formated ANSI color code + * @returns {Promise} - The formatted ANSI color code * @throws {Error} - A Format Error */ function rgbToAnsi (hex, extendedColor) { @@ -131,11 +132,11 @@ Gray Scale Color /** * A class to work with syslog messages using UDP, TCP, or TLS transport. - * There is suport for Syslog message formating RFC-3164, RFC-5424 including + * There is support for Syslog message formatting RFC-3164, RFC-5424 including * Structured Data, IBM LEEF (Log Event Extended Format), and HP CEF (Common * Event Format). - * Syslog formating classes can be used as input into a Syslog class to be used - * simultatniusly to the same Syslog server. * + * Syslog formatting classes can be used as input into a Syslog class to be used + * simultaneously to the same Syslog server. * * @requires moment * @version 0.0.0 * @since 0.0.0 @@ -148,27 +149,27 @@ class Syslog { * @since 0.0.0 * @this Syslog * @param {object} [options] - Options object - * >>>Transport Configuraton + * >>>Transport Configuration * @param {string} [options.target='localhost'] - The IP Address|FQDN of the - * Syslog Server, this option if set will take prasdents over any target - * set in a formating object - * @param {string} [options.protocol='udp'] - L4 transport portocol - * (udp|tcp|tls), this option if set will take prasdents over any transport - * set in a formating object + * Syslog Server, this option if set will take presidents over any target + * set in a formatting object + * @param {string} [options.protocol='udp'] - L4 transport protocol + * (udp|tcp|tls), this option if set will take presidents over any transport + * set in a formatting object * @param {number} [options.port=514] - IP port, this option if set will take - * prasdents over any IP Port set in a formating object + * presidents over any IP Port set in a formatting object * @param {number} [options.tcpTimeout=10000] - Ignored for all other - * transports, this option if set will take prasdents over any timeout - * set in a formating object - * @param {string[]} [options.tlsServerCerts] - Array of authrized TLS server - * certificates file locations, this option if set will take prasdents - * over any certificates set in a formating object + * transports, this option if set will take presidents over any timeout + * set in a formatting object + * @param {string[]} [options.tlsServerCerts] - Array of authorized TLS server + * certificates file locations, this option if set will take presidents + * over any certificates set in a formatting object * @param {string} [options.tlsClientCert] - Client TLS certificate file * location that this client should use, this option if set will take - * prasdents over any certificates set in a formating object + * presidents over any certificates set in a formatting object * @param {string} [options.tlsClientKey] - Client TLS key file * location that this client should use, this option if set will take - * prasdents over any certificates set in a formating object + * presidents over any certificates set in a formatting object * >>>Syslog Format Settings * @param {string} [options.format='none'] - Valid syslog format options for * this module are 'none', 'rfc3164', 'rfc5424', 'leef', 'cef' @@ -179,7 +180,7 @@ class Syslog { * @param {LEEF} [options.leef] - {@link module:SyslogPro~LEEF|IBM LEEF * (Log Event Extended Format) object} * @param {CEF} [options.cef] - {@link module:SyslogPro~CEF|HP CEF - * (Common Event Format) formating object} + * (Common Event Format) formatting object} */ constructor (options) { this.constructor__ = true; @@ -294,9 +295,9 @@ Syslog Format } /** - * Add a TLS server certificate which can be used to authentacat the server - * this syslog client is connecting too. This function will valadate the - * input as a file location straing and add it to an array of certificates + * Add a TLS server certificate which can be used to authenticate the server + * this syslog client is connecting too. This function will validate the + * input as a file location string and add it to an array of certificates * @private * @version 0.0.0 * @since 0.0.0 @@ -312,7 +313,7 @@ Syslog Format } else if (typeof certs === 'string') { this.tlsServerCerts = [certs]; } else { - let errMsg = 'TYPE ERROR: Server Cert file loctions shoudl be a string'; + let errMsg = 'TYPE ERROR: Server Cert file locations should be a string'; errMsg += ' or array of strings'; reject(new Error(errMsg)); } @@ -322,8 +323,8 @@ Syslog Format /** * Send the Syslog message over UDP * @private - * @param {string} msg - The formated Syslog Message - * @returns {Promise} - The Syslog formated string sent + * @param {string} msg - The formatted Syslog Message + * @returns {Promise} - The Syslog formatted string sent * @throws {Error} - Network Error */ udpMessage (msg) { @@ -365,8 +366,8 @@ Turn msg in to a UTF8 buffer /** * Send the Syslog message over TCP * @private - * @param {string} msg - The formated Syslog Message - * @returns {Promise} - The Syslog formated string sent + * @param {string} msg - The formatted Syslog Message + * @returns {Promise} - The Syslog formatted string sent * @throws {Error} - Timeout error for TCP and TLS connections * @throws {Error} - Network Error */ @@ -425,8 +426,8 @@ Turn msg in to a UTF8 buffer /** * Send the Syslog message over TLS * @private - * @param {string} msg - The formated Syslog Message - * @returns {Promise} - The Syslog formated string sent + * @param {string} msg - The formatted Syslog Message + * @returns {Promise} - The Syslog formatted string sent * @throws {Error} - Timeout error for TCP and TLS connections * @throws {Error} - Network Error */ @@ -499,7 +500,7 @@ Load any server certs if provided tlsOptions.ca = tlsOptionsCerts; tlsOptions.rejectUnauthorized = true; } - const client = tls.connect(tlsOptions, () => { + const client = tls.connect(tlsOptions, () => { ``` @@ -521,21 +522,6 @@ Turn msg in to a UTF8 buffer }); }); client.setTimeout(this.tcpTimeout); - -``` - - - - - - - -client.on('data', (data) => {}); - - - - -``` client.on('end', () => { resolve(msg); }); @@ -553,8 +539,8 @@ client.on('data', (data) => {}); * Send the Syslog message to the selected target Syslog server using the * selected transport. * @private - * @param {string} msg - The formated Syslog Message - * @returns {Promise} - The Syslog formated string sent + * @param {string} msg - The formatted Syslog Message + * @returns {Promise} - The Syslog formatted string sent * @throws {Error} - Timeout error for TCP and TLS connections * @throws {Error} - Network Error */ @@ -590,7 +576,7 @@ client.on('data', (data) => {}); reject(reson); }); } else { - let errorMsg = 'FORMAT ERROR: Protocol not reconized, should be '; + let errorMsg = 'FORMAT ERROR: Protocol not recognized, should be '; errorMsg += 'udp|tcp|tls'; reject(new Error(errorMsg)); } @@ -599,38 +585,38 @@ client.on('data', (data) => {}); } /** - * A class to work with RFC3164 formated syslog messages. The meesaging is fully configurabule and Ansi foreground - * colors can be added. Both ANSI 8 and ANSI 256 color are fully suported. + * A class to work with RFC3164 formatted syslog messages. The messaging is fully configurable and ANSI foreground + * colors can be added. Both ANSI 8 and ANSI 256 color are fully supported. * Most APIs will return a promise. These APIs can be used using * `then(...)/catch(...)` * * A Syslog class with a configured - * Syslog server target can also be used as the input into the formating - * classes so that it may run independtly. + * Syslog server target can also be used as the input into the formatting + * classes so that it may run independently. * - * The RFC3164 Syslog logging format is ment to be used as a stream of log data - * from a service or applacation. This class is designed to be used in this - * fashion where new messages are writen to the class as needed. + * The RFC3164 Syslog logging format is meant to be used as a stream of log data + * from a service or application. This class is designed to be used in this + * fashion where new messages are written to the class as needed. * @requires moment * @version 0.0.0 * @since 0.0.0 */ class RFC3164 { /** - * Construct a new RFC3164 formated Syslog object with user options + * Construct a new RFC3164 formatted Syslog object with user options * @public * @this RFC3164 * @param {object} [options] - Options object - * @param {string} [options.applacationName='NodeJSLogger'] - Applacation + * @param {string} [options.applacationName='NodeJSLogger'] - Application * @param {string} [options.hostname=os.hostname] - The name of this server * @param {number} [options.facility=23] - Facility code to use sending this * message * @param {boolean} [options.color=false] - Apply color coding encoding tag * with syslog message text - * @param {boolean} [options.extendedColor=false] - Use the extedned ANSI + * @param {boolean} [options.extendedColor=false] - Use the extended ANSI * color set encoding tag with syslog message text * @param {object} [options.colors] - User defended colors for - * severites + * severities * @param {string} [options.colors.emergencyColor] - A RGB Hex coded color in the form * of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 * Extended) @@ -887,14 +873,14 @@ class RFC3164 { }); } /** - * Building a formated message. Returns a promise with a formated message + * Building a formatted message. Returns a promise with a formatted message * @public * @param {string} msg - The Syslog Message * @param {object} [options] - Options object * @param {number} [options.severity=7] - An array of structure * @param {number} [options.colorCode=36] - The ANSI color code to use if * message coloration is selected - * @returns {Promise} A Syslog formated string acording to the selected RFC + * @returns {Promise} A Syslog formatted string according to the selected RFC * @throws {Error} A standard error object */ buildMessage (msg, options) { @@ -908,7 +894,7 @@ class RFC3164 { reject(new Error(errMsg)); return; } - let fmtMsg = ''; // Formated Syslog message string var + let fmtMsg = ''; // Formatted Syslog message string var const newLine = '\n'; const newLineRegEx = /(\r|\n|(\r\n))/; const escapeCode = '\u001B'; @@ -944,7 +930,7 @@ Remove any newline character ``` - msg = msg.replace(newLineRegEx, ''); + msg = msg.replace(newLineRegEx, ''); ``` @@ -970,7 +956,7 @@ Add requested color colorCode += options.msgColor; colorCode += 'm'; // ANSI Color Closer } else { - colorCode = '[39m'; // Use terminal's defualt color + colorCode = '[39m'; // Use terminal's default color } msg = escapeCode + colorCode + msg + resetColor; } @@ -983,8 +969,7 @@ Add requested color -RegEx to find a leading 0 in the day of a DateTime for RFC3164 -RFC3164 uses BSD timeformat +RegEx to find a leading 0 in the day of a DateTime for RFC3164 RFC3164 uses BSD timeformat @@ -1003,7 +988,7 @@ RFC3164 uses BSD timeformat -Build message +Build message @@ -1019,16 +1004,16 @@ Build message }); } /** - * send a RFC5424 formated message. Returns a promise with the formated + * send a RFC5424 formatted message. Returns a promise with the formatted * message that was sent. If no server connection was defined when the - * class was created a defualt Syslog connector will be used. + * class was created a default Syslog connector will be used. * @see SyslogPro~Syslog * @public - * @param {string} msg - The unformated Syslog message to send + * @param {string} msg - The unformatted Syslog message to send * @param {object} [options] - Options object * @param {number} [options.severity=7] - An array of structure * @param {number} [options.colorCode=36] - The ANSI color code to use if - * @returns {Promise} A Syslog formated string acording to the selected RFC + * @returns {Promise} A Syslog formatted string according to the selected RFC * @throws {Error} A standard error object */ send (msg, options) { @@ -1052,11 +1037,11 @@ Build message }); } /** - * Send a syslog message with a secerity level of 0 (Emergency) + * Send a syslog message with a security level of 0 (Emergency) * @public - * @param {string} msg - The emergancy message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @param {string} msg - The emergency message to send to the Syslog server + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ emergency (msg) { return this.send(msg, { @@ -1065,21 +1050,21 @@ Build message }); } /** - * Send a syslog message with a secerity level of 0 (Emergency) + * Send a syslog message with a security level of 0 (Emergency) * @public - * @param {string} msg - The emergancy message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @param {string} msg - The emergency message to send to the Syslog server + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ emer (msg) { return this.emergency(msg); } /** - * Send a syslog message with a secerity level of 1 (Alert) + * Send a syslog message with a severity level of 1 (Alert) * @public * @param {string} msg - The alert message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ alert (msg) { return this.send(msg, { @@ -1088,11 +1073,11 @@ Build message }); } /** - * Send a syslog message with a secerity level of 2 (Critical) + * Send a syslog message with a severity level of 2 (Critical) * @public * @param {string} msg - The critical message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ critical (msg) { return this.send(msg, { @@ -1101,21 +1086,21 @@ Build message }); } /** - * Send a syslog message with a secerity level of 2 (Critical) + * Send a syslog message with a severity level of 2 (Critical) * @public * @param {string} msg - The critical message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ crit (msg) { return this.critical(msg); } /** - * Send a syslog message with a secerity level of 3 (Error) + * Send a syslog message with a severity level of 3 (Error) * @public * @param {string} msg - The error message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ error (msg) { return this.send(msg, { @@ -1124,21 +1109,21 @@ Build message }); } /** - * Send a syslog message with a secerity level of 3 (Error) + * Send a syslog message with a severity level of 3 (Error) * @public * @param {string} msg - The error message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ err (msg) { return this.error(msg); } /** - * Send a syslog message with a secerity level of 4 (Warning) + * Send a syslog message with a severity level of 4 (Warning) * @public * @param {string} msg - The warning message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ warning (msg) { return this.send(msg, { @@ -1147,21 +1132,21 @@ Build message }); } /** - * Send a syslog message with a secerity level of 4 (Warning) + * Send a syslog message with a severity level of 4 (Warning) * @public * @param {string} msg - The warning message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ warn (msg) { return this.warning(msg); } /** - * Send a syslog message with a secerity level of 5 (Notice) + * Send a syslog message with a severity level of 5 (Notice) * @public * @param {string} msg - The notice message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ notice (msg) { return this.send(msg, { @@ -1170,21 +1155,21 @@ Build message }); } /** - * Send a syslog message with a secerity level of 5 (Notice) + * Send a syslog message with a severity level of 5 (Notice) * @public * @param {string} msg - The notice message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ note (msg) { return this.notice(msg); } /** - * Send a syslog message with a secerity level of 6 (Informational) + * Send a syslog message with a severity level of 6 (Informational) * @public * @param {string} msg - The informational message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ informational (msg) { return this.send(msg, { @@ -1193,31 +1178,31 @@ Build message }); } /** - * Send a syslog message with a secerity level of 6 (Informational) + * Send a syslog message with a severity level of 6 (Informational) * @public * @param {string} msg - The informational message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ info (msg) { return this.informational(msg); } /** - * Send a syslog message with a secerity level of 6 (Informational) + * Send a syslog message with a severity level of 6 (Informational) * @public * @param {string} msg - The informational message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ log (msg) { return this.informational(msg); } /** - * Send a syslog message with a secerity level of 7 (Debug) + * Send a syslog message with a severity level of 7 (Debug) * @public * @param {string} msg - The debug message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ debug (msg) { return this.send(msg, { @@ -1228,37 +1213,37 @@ Build message } /** - * A class to work with RFC5424 formated syslog messages. The meesaging is fully configurabule and Ansi foreground - * colors can be added. Both ANSI 8 and ANSI 256 color are fully suported. + * A class to work with RFC5424 formatted syslog messages. The messaging is fully configurable and ANSI foreground + * colors can be added. Both ANSI 8 and ANSI 256 color are fully supported. * Most APIs will return a promise. These APIs can be used using * `then(...)/catch(...)` * * A Syslog class with a configured - * Syslog server target can also be used as the input into the formating - * classes so that it may run independtly. + * Syslog server target can also be used as the input into the formatting + * classes so that it may run independently. * - * The RFC5424 Syslog logging format is ment to be used as a stream of log data - * from a service or applacation. This class is designed to be used in this - * fashion where new messages are writen to the class as needed. + * The RFC5424 Syslog logging format is meant to be used as a stream of log data + * from a service or application. This class is designed to be used in this + * fashion where new messages are written to the class as needed. * @requires moment * @version 0.0.0 * @since 0.0.0 */ class RFC5424 { /** - * Construct a new RFC5424 formated Syslog object with user options + * Construct a new RFC5424 formatted Syslog object with user options * @public * @this RFC5424 * @param {object} [options] - Options object - * @param {string} [options.applacationName='NodeJSLogger'] - Applacation + * @param {string} [options.applacationName='NodeJSLogger'] - Application * @param {string} [options.hostname=os.hostname] - The name of this server * @param {boolean} [options.timestamp=false] - Included a Timestamp - * @param {boolean} [options.timestampUTC=false] - RFC tandard is for + * @param {boolean} [options.timestampUTC=false] - RFC standard is for * local time * @param {boolean} [options.timestampMS=false] - Timestamp with ms - * resoltuion + * resolution * @param {boolean} [options.timestampTZ=true] - Should the timestamp - * included timezone + * included time zone * @param {boolean} [options.encludeStructuredData=false] - Included * any provided structured data * @param {boolean} [options.utf8BOM=true] - Included the UTF8 @@ -1266,7 +1251,7 @@ class RFC5424 { * @param {boolean} [options.extendedColor=false] - Included the UTF8 * encoding tag with syslog message text * @param {object} [options.colors] - User defended colors for - * severites + * severities * @param {string} [options.colors.emergencyColor] - A RGB Hex coded color in the form * of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 * Extended) @@ -1558,7 +1543,7 @@ class RFC5424 { }); } /** - * Building a formated message. Returns a promise with a formated message + * Building a formatted message. Returns a promise with a formatted message * @public * @param {string} msg - The Syslog Message * @param {object} [options] - Options object @@ -1569,12 +1554,12 @@ class RFC5424 { * this message * @param {string[]} [options.structuredData] - An array of structure * data strings conforming to the IETF/IANA defined SD-IDs or IANA - * registred SMI Network Management Private Enterprise Code SD-ID + * registered SMI Network Management Private Enterprise Code SD-ID * conforming to the format * [name@ parameter=value] * @param {number} [options.colorCode=36] - The ANSI color code to use if * message coloration is selected - * @returns {Promise} A Syslog formated string acording to the selected RFC + * @returns {Promise} A Syslog formatted string according to the selected RFC * @throws {Error} A standard error object */ buildMessage (msg, options) { @@ -1628,7 +1613,7 @@ Remove any newline character ``` - msg = msg.replace(newLineRegEx, ''); + msg = msg.replace(newLineRegEx, ''); ``` @@ -1654,7 +1639,7 @@ Add requested color colorCode += options.msgColor; colorCode += 'm'; // ANSI Color Closer } else { - colorCode = '[39m'; // Use terminal's defualt color + colorCode = '[39m'; // Use terminal's default color } msg = escapeCode + colorCode + msg + resetColor; } @@ -1797,13 +1782,13 @@ Build the message }); } /** - * send a RFC5424 formated message. Returns a promise with the formated + * send a RFC5424 formatted message. Returns a promise with the formatted * message that was sent. If no server connection was defined when the - * class was created a defualt Syslog connector will be used. + * class was created a default Syslog connector will be used. * @see SyslogPro~Syslog * @public - * @param {string} msg - The unformated Syslog message to send - * @returns {Promise} A Syslog formated string acording to the selected RFC + * @param {string} msg - The unformatted Syslog message to send + * @returns {Promise} A Syslog formatted string according to the selected RFC * @throws {Error} A standard error object */ send (msg, options) { @@ -1827,11 +1812,11 @@ Build the message }); } /** - * Send a syslog message with a secerity level of 0 (Emergency) + * Send a syslog message with a severity level of 0 (Emergency) * @public - * @param {string} msg - The emergancy message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @param {string} msg - The emergency message to send to the Syslog server + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ emergency (msg) { return this.send(msg, { @@ -1840,21 +1825,21 @@ Build the message }); } /** - * Send a syslog message with a secerity level of 0 (Emergency) + * Send a syslog message with a severity level of 0 (Emergency) * @public - * @param {string} msg - The emergancy message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @param {string} msg - The emergency message to send to the Syslog server + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ emer (msg) { return this.emergency(msg); } /** - * Send a syslog message with a secerity level of 1 (Alert) + * Send a syslog message with a severity level of 1 (Alert) * @public * @param {string} msg - The alert message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ alert (msg) { return this.send(msg, { @@ -1863,11 +1848,11 @@ Build the message }); } /** - * Send a syslog message with a secerity level of 2 (Critical) + * Send a syslog message with a severity level of 2 (Critical) * @public * @param {string} msg - The critical message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ critical (msg) { return this.send(msg, { @@ -1876,21 +1861,21 @@ Build the message }); } /** - * Send a syslog message with a secerity level of 2 (Critical) + * Send a syslog message with a severity level of 2 (Critical) * @public * @param {string} msg - The critical message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ crit (msg) { return this.critical(msg); } /** - * Send a syslog message with a secerity level of 3 (Error) + * Send a syslog message with a severity level of 3 (Error) * @public * @param {string} msg - The error message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ error (msg) { return this.send(msg, { @@ -1899,21 +1884,21 @@ Build the message }); } /** - * Send a syslog message with a secerity level of 3 (Error) + * Send a syslog message with a severity level of 3 (Error) * @public * @param {string} msg - The error message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ err (msg) { return this.error(msg); } /** - * Send a syslog message with a secerity level of 4 (Warning) + * Send a syslog message with a severity level of 4 (Warning) * @public * @param {string} msg - The warning message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ warning (msg) { return this.send(msg, { @@ -1922,21 +1907,21 @@ Build the message }); } /** - * Send a syslog message with a secerity level of 4 (Warning) + * Send a syslog message with a severity level of 4 (Warning) * @public * @param {string} msg - The warning message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ warn (msg) { return this.warning(msg); } /** - * Send a syslog message with a secerity level of 5 (Notice) + * Send a syslog message with a severity level of 5 (Notice) * @public * @param {string} msg - The notice message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ notice (msg) { return this.send(msg, { @@ -1945,21 +1930,21 @@ Build the message }); } /** - * Send a syslog message with a secerity level of 5 (Notice) + * Send a syslog message with a severity level of 5 (Notice) * @public * @param {string} msg - The notice message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ note (msg) { return this.notice(msg); } /** - * Send a syslog message with a secerity level of 6 (Informational) + * Send a syslog message with a severity level of 6 (Informational) * @public * @param {string} msg - The informational message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ informational (msg) { return this.send(msg, { @@ -1968,31 +1953,31 @@ Build the message }); } /** - * Send a syslog message with a secerity level of 6 (Informational) + * Send a syslog message with a severity level of 6 (Informational) * @public * @param {string} msg - The informational message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ info (msg) { return this.informational(msg); } /** - * Send a syslog message with a secerity level of 6 (Informational) + * Send a syslog message with a severity level of 6 (Informational) * @public * @param {string} msg - The informational message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ log (msg) { return this.informational(msg); } /** - * Send a syslog message with a secerity level of 7 (Debug) + * Send a syslog message with a severity level of 7 (Debug) * @public * @param {string} msg - The debug message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ debug (msg) { return this.send(msg, { @@ -2006,34 +1991,34 @@ Build the message * A class to work with IBM LEEF (Log Event Extended Format) messages this form * of system messages are designed to work with security systems. Messages can * be saved to file (Saving to file if not part of this module but a LEEF - * formated mesage produced by this module can be saved externaly to it) or + * formatted message produced by this module can be saved externally to it) or * sent via Syslog. * Most APIs will return a promise. These APIs can be used using * `then(...)/catch(...)` * * A Syslog class with a configured Syslog server target can also be used as - * the input into the formating classes so that it may run independtly. The + * the input into the formatting classes so that it may run independently. The * LEEF format is designed to send event data to a SIEM system and should not - * be as a logging stream. This class is ment to be used once per message. + * be as a logging stream. This class is meant to be used once per message. * @requires moment * @version 0.0.0 * @since 0.0.0 */ class LEEF { /** - * Construct a new LEEF formating object with user options + * Construct a new LEEF formatting object with user options * @public * @param {object} [options] - Options object * @param {string} [options.vendor='unknown'] - The vendor of the system that - * genrated the event being reported + * generated the event being reported * @param {string} [options.product='unknown'] - The product name of the * system that genrated the event being reported * @param {string} [options.version='unknown'] - The version name of the * system that genrated the event being reported * @param {string} [options.eventId='unknown'] - The eventId of the * system that genrated the event being reported - * @param {object} [options.attrabute] - LEEF message attrabutes which - * defualts to all base attrabutes with null values, new attrabutes should + * @param {object} [options.attributes] - LEEF message attributes which + * defaults to all base attributes with null values, new attributes should * be added as new elements to this object * @param {boolean} [options.syslogHeader='true'] - Should the LEEF message * include a Syslog header with Timestamp and source @@ -2057,7 +2042,7 @@ class LEEF { this.syslogHeader = typeof options.syslogHeader === 'boolean' ? options.syslogHeader : true; /** @type {object} */ - this.attrabutes = options.attrabutes || { + this.attributes = options.attributes || { cat: null, devTime: null, devTimeFormat: null, @@ -2115,9 +2100,9 @@ class LEEF { } } /** - *Build a formated message + *Build a formatted message * @public - * @return {Promise} - string with formated message + * @return {Promise} - string with formatted message */ buildMessage () { return new Promise((resolve, reject) => { @@ -2137,14 +2122,14 @@ class LEEF { -Build LEEF Attrabuites +Build LEEF Attributes ``` const Tab = '\x09'; - const leefAttribs = Object.entries(this.attrabutes); + const leefAttribs = Object.entries(this.attributes); const leefAttribsLen = leefAttribs.length; for (let attrib = 0; attrib < leefAttribsLen; attrib++) { if (leefAttribs[attrib][1] !== null) { @@ -2184,36 +2169,36 @@ Build LEEF Attrabuites * A class to work with HP CEF (Common Event Format) messages. This form * of system messages are designed to work with security systems. Messages can * be saved to file (Saving to file if not part of this module but a CEF - * formated mesage produced by this module can be saved externaly to it) or + * formatted message produced by this module can be saved externally to it) or * sent via Syslog. * Most APIs will return a promise. These APIs can be used using * `then(...)/catch(...)` * * A Syslog class with a configured Syslog server target can also be used as - * the input into the formating classes so that it may run independtly. The CEF + * the input into the formatting classes so that it may run independently. The CEF * format is designed to send event data to a SIEM system and should not be as - * a logging stream. This class is ment to be used once per message. + * a logging stream. This class is meant to be used once per message. * @requires moment * @version 0.0.0 * @since 0.0.0 */ class CEF { /** - * Construct a new CEF formating object with user options + * Construct a new CEF formatting object with user options * @public * @param {object} [options] - Options object * @param {string} [options.deviceVendor='unknown'] - The vendor of the system - * that genrated the event being reported + * that generated the event being reported * @param {string} [options.deviceProduct='unknown'] - The product name of the * system that genrated the event being reported * @param {string} [options.deviceVersion='unknown'] - The version name of the * system that genrated the event being reported * @param {string} [options.deviceEventClassId='unknown'] - The eventId of the * system that genrated the event being reported - * @param {string} [options.name='unknown'] - Name of the service genrating + * @param {string} [options.name='unknown'] - Name of the service generating * the notice * @param {string} [options.severity='unknown'] - Severity of the notification - * @param {string} [options.extensions={}] - Any CEF Key=Value extentions + * @param {string} [options.extensions={}] - Any CEF Key=Value extensions * @param {Syslog} [options.server=false] - A {@link module:SyslogPro~Syslog| * Syslog server connection} that should be used to send messages directly * from this class. @see SyslogPro~Syslog @@ -2406,8 +2391,8 @@ class CEF { /** * Validate this CEF object * @public - * @return {Promise} - True if valadated - * @throws {Error} - First element to fail valadation + * @return {Promise} - True if validated + * @throws {Error} - First element to fail validation */ validate () { return new Promise ((resolve, reject) => { @@ -2692,6 +2677,8 @@ module.exports = { Syslog: Syslog }; + + ``` diff --git a/docs/docco/index.html b/docs/docco/index.html index 96292a4..8ea2e69 100644 --- a/docs/docco/index.html +++ b/docs/docco/index.html @@ -27,7 +27,8 @@
- +

INDEX.JS

+
/** Copyright (c) 2018 Craig Yamato */
@@ -37,10 +38,10 @@
  * Most APIs will return a promise. These APIs can be used using 
  * `then(...)/catch(...)`
  *
- * Syslog formating classes can be used as input into a Syslog class to be used 
- * simultatniusly to the same Syslog server.  The Syslog Class with a configured
- * Syslog server target can also be used as the input into each of the formating 
- * classes so that they may run independtly.
+ * Syslog formatting classes can be used as input into a Syslog class to be used 
+ * simultaneously to the same Syslog server.  The Syslog Class with a configured
+ * Syslog server target can also be used as the input into each of the formatting 
+ * classes so that they may run independently.
  * @author Craig Yamato <craig@kentik.com>
  * @copyright (c) 2018 - Craig Yamato
  * @version 0.1.0
@@ -61,7 +62,7 @@
  * @private
  * @param {string} hex - The color hex code in the form of #FFFFFF or Number of
  *     the ANSI color code (30-37 Standard & 0-255 Extended)
- * @returns {Promise} - The formated ANSI color code
+ * @returns {Promise} - The formatted ANSI color code
  * @throws {Error} - A Format Error
  */
 function rgbToAnsi (hex, extendedColor) {
@@ -152,11 +153,11 @@
 
 /**
  * A class to work with syslog messages using UDP, TCP, or TLS transport.  
- * There is suport for Syslog message formating RFC-3164, RFC-5424 including 
+ * There is support for Syslog message formatting RFC-3164, RFC-5424 including 
  * Structured Data, IBM LEEF (Log Event Extended Format), and HP CEF (Common
  * Event Format).
- * Syslog formating classes can be used as input into a Syslog class to be used 
- * simultatniusly to the same Syslog server. * 
+ * Syslog formatting classes can be used as input into a Syslog class to be used 
+ * simultaneously to the same Syslog server. * 
  * @requires moment
  * @version 0.0.0
  * @since 0.0.0
@@ -169,27 +170,27 @@
    * @since 0.0.0
    * @this Syslog
    * @param {object} [options] - Options object
-   * >>>Transport Configuraton
+   * >>>Transport Configuration
    * @param {string} [options.target='localhost'] - The IP Address|FQDN of the 
-   *    Syslog Server, this option if set will take prasdents over any target 
-   *    set in a formating object
-   * @param {string} [options.protocol='udp'] - L4 transport portocol 
-   *    (udp|tcp|tls), this option if set will take prasdents over any transport 
-   *    set in a formating object
+   *    Syslog Server, this option if set will take presidents over any target 
+   *    set in a formatting object
+   * @param {string} [options.protocol='udp'] - L4 transport protocol 
+   *    (udp|tcp|tls), this option if set will take presidents over any transport 
+   *    set in a formatting object
    * @param {number} [options.port=514] - IP port, this option if set will take 
-   *    prasdents over any IP Port set in a formating object
+   *    presidents over any IP Port set in a formatting object
    * @param {number} [options.tcpTimeout=10000] - Ignored for all other 
-   *    transports, this option if set will take prasdents over any timeout 
-   *    set in a formating object
-   * @param {string[]} [options.tlsServerCerts] - Array of authrized TLS server
-   *    certificates file locations, this option if set will take prasdents 
-   *    over any certificates set in a formating object
+   *    transports, this option if set will take presidents over any timeout 
+   *    set in a formatting object
+   * @param {string[]} [options.tlsServerCerts] - Array of authorized TLS server
+   *    certificates file locations, this option if set will take presidents 
+   *    over any certificates set in a formatting object
    * @param {string} [options.tlsClientCert] - Client TLS certificate file 
    *    location that this client should use, this option if set will take 
-   *    prasdents over any certificates set in a formating object
+   *    presidents over any certificates set in a formatting object
    * @param {string} [options.tlsClientKey] - Client TLS key file 
    *    location that this client should use, this option if set will take 
-   *    prasdents over any certificates set in a formating object
+   *    presidents over any certificates set in a formatting object
    * >>>Syslog Format Settings
    * @param {string} [options.format='none'] - Valid syslog format options for 
    *    this module are 'none', 'rfc3164', 'rfc5424', 'leef', 'cef'
@@ -200,7 +201,7 @@
    * @param {LEEF} [options.leef] - {@link module:SyslogPro~LEEF|IBM LEEF 
    *    (Log Event Extended Format) object} 
    * @param {CEF} [options.cef] - {@link module:SyslogPro~CEF|HP CEF 
-   *    (Common Event Format) formating object} 
+   *    (Common Event Format) formatting object} 
    */
   constructor (options) {
     this.constructor__ = true;
@@ -313,9 +314,9 @@
   }
   
   /**
-   * Add a TLS server certificate which can be used to authentacat the server 
-   * this syslog client is connecting too.  This function will valadate the
-   * input as a file location straing and add it to an array of certificates
+   * Add a TLS server certificate which can be used to authenticate the server 
+   * this syslog client is connecting too.  This function will validate the
+   * input as a file location string and add it to an array of certificates
    * @private
    * @version 0.0.0
    * @since 0.0.0
@@ -331,7 +332,7 @@
       } else if (typeof certs === 'string') {
         this.tlsServerCerts = [certs];
       } else {
-        let errMsg = 'TYPE ERROR: Server Cert file loctions shoudl be a string';
+        let errMsg = 'TYPE ERROR: Server Cert file locations should be a string';
         errMsg += ' or array of strings';
         reject(new Error(errMsg));
       }
@@ -341,8 +342,8 @@
   /**
    * Send the Syslog message over UDP
    * @private
-   * @param {string} msg - The formated Syslog Message
-   * @returns {Promise} - The Syslog formated string sent
+   * @param {string} msg - The formatted Syslog Message
+   * @returns {Promise} - The Syslog formatted string sent
    * @throws {Error} - Network Error
    */
   udpMessage (msg) {
@@ -383,8 +384,8 @@
   /**
    * Send the Syslog message over TCP
    * @private
-   * @param {string} msg - The formated Syslog Message
-   * @returns {Promise} - The Syslog formated string sent
+   * @param {string} msg - The formatted Syslog Message
+   * @returns {Promise} - The Syslog formatted string sent
    * @throws {Error} - Timeout error for TCP and TLS connections
    * @throws {Error} - Network Error
    */
@@ -442,8 +443,8 @@
   /**
    * Send the Syslog message over TLS
    * @private
-   * @param {string} msg - The formated Syslog Message
-   * @returns {Promise} - The Syslog formated string sent
+   * @param {string} msg - The formatted Syslog Message
+   * @returns {Promise} - The Syslog formatted string sent
    * @throws {Error} - Timeout error for TCP and TLS connections
    * @throws {Error} - Network Error
    */
@@ -534,22 +535,8 @@
           client.end();
         });
       });
-      client.setTimeout(this.tcpTimeout);
- - - - -
  • -
    - -
    - -
    -

    client.on(‘data’, (data) => {});

    - -
    - -
          client.on('end', () => {
    +      client.setTimeout(this.tcpTimeout);
    +      client.on('end', () => {
             resolve(msg);
           });
           client.on('timeout', () => {
    @@ -566,8 +553,8 @@
        * Send the Syslog message to the selected target Syslog server using the 
        * selected transport.
        * @private
    -   * @param {string} msg - The formated Syslog Message
    -   * @returns {Promise} - The Syslog formated string sent
    +   * @param {string} msg - The formatted Syslog Message
    +   * @returns {Promise} - The Syslog formatted string sent
        * @throws {Error} - Timeout error for TCP and TLS connections
        * @throws {Error} - Network Error
        */
    @@ -603,7 +590,7 @@
                   reject(reson);
                 });
           } else {
    -        let errorMsg = 'FORMAT ERROR: Protocol not reconized, should be ';
    +        let errorMsg = 'FORMAT ERROR: Protocol not recognized, should be ';
             errorMsg += 'udp|tcp|tls';
             reject(new Error(errorMsg));
           }
    @@ -612,38 +599,38 @@
     }
      
     /**
    - * A class to work with RFC3164 formated syslog messages. The meesaging is fully configurabule and Ansi foreground 
    - * colors can be added.  Both ANSI 8 and ANSI 256 color are fully suported.
    + * A class to work with RFC3164 formatted syslog messages. The messaging is fully configurable and ANSI foreground 
    + * colors can be added.  Both ANSI 8 and ANSI 256 color are fully supported.
      * Most APIs will return a promise. These APIs can be used using 
      * `then(...)/catch(...)`
      * 
      * A Syslog class with a configured
    - * Syslog server target can also be used as the input into the formating 
    - * classes so that it may run independtly.
    + * Syslog server target can also be used as the input into the formatting 
    + * classes so that it may run independently.
      * 
    - * The RFC3164 Syslog logging format is ment to be used as a stream of log data 
    - * from a service or applacation. This class is designed to be used in this
    - * fashion where new messages are writen to the class as needed.
    + * The RFC3164 Syslog logging format is meant to be used as a stream of log data 
    + * from a service or application. This class is designed to be used in this
    + * fashion where new messages are written to the class as needed.
      * @requires moment
      * @version 0.0.0
      * @since 0.0.0
      */
     class RFC3164 {
       /**
    -   * Construct a new RFC3164 formated Syslog object with user options 
    +   * Construct a new RFC3164 formatted Syslog object with user options 
        * @public
        * @this RFC3164
        * @param {object} [options] - Options object
    -   * @param {string} [options.applacationName='NodeJSLogger'] - Applacation
    +   * @param {string} [options.applacationName='NodeJSLogger'] - Application
        * @param {string} [options.hostname=os.hostname] - The name of this server
        * @param {number} [options.facility=23] - Facility code to use sending this 
        *    message 
        * @param {boolean} [options.color=false] - Apply color coding encoding tag 
        *    with syslog message text 
    -   * @param {boolean} [options.extendedColor=false] - Use the extedned ANSI 
    +   * @param {boolean} [options.extendedColor=false] - Use the extended ANSI 
        *    color set encoding tag with syslog message text 
        * @param {object} [options.colors] - User defended colors for 
    -   *    severites
    +   *    severities
        * @param {string} [options.colors.emergencyColor] - A RGB Hex coded color in the form 
        *    of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 
        *    Extended)
    @@ -900,14 +887,14 @@
         });
       }
       /**
    -   * Building a formated message.  Returns a promise with a formated message 
    +   * Building a formatted message.  Returns a promise with a formatted message 
        * @public
        * @param {string} msg - The Syslog Message
        * @param {object} [options] - Options object
        * @param {number} [options.severity=7] - An array of structure 
        * @param {number} [options.colorCode=36] - The ANSI color code to use if 
        *    message coloration is selected
    -   * @returns {Promise} A Syslog formated string acording to the selected RFC
    +   * @returns {Promise} A Syslog formatted string according to the selected RFC
        * @throws {Error} A standard error object
        */
       buildMessage (msg, options) {
    @@ -921,7 +908,7 @@
             reject(new Error(errMsg));
             return;
           }
    -      let fmtMsg = ''; // Formated Syslog message string var
    +      let fmtMsg = ''; // Formatted Syslog message string var
           const newLine = '\n';
           const newLineRegEx = /(\r|\n|(\r\n))/;
           const escapeCode = '\u001B';
    @@ -930,11 +917,11 @@
             
  • -
  • +
  • - +

    The PRI is common to both RFC formats

    @@ -945,11 +932,11 @@
  • -
  • +
  • - +

    Remove any newline character

    @@ -960,11 +947,11 @@
  • -
  • +
  • - +

    Add requested color

    @@ -980,7 +967,7 @@ colorCode += options.msgColor; colorCode += 'm'; // ANSI Color Closer } else { - colorCode = '[39m'; // Use terminal's defualt color + colorCode = '[39m'; // Use terminal's default color } msg = escapeCode + colorCode + msg + resetColor; }
    @@ -988,14 +975,13 @@
  • -
  • +
  • - +
    -

    RegEx to find a leading 0 in the day of a DateTime for RFC3164 -RFC3164 uses BSD timeformat

    +

    RegEx to find a leading 0 in the day of a DateTime for RFC3164 RFC3164 uses BSD timeformat

    @@ -1007,13 +993,13 @@ RFC3164 uses BSD timeformat

  • -
  • +
  • - +
    -

    Build message

    +

    Build message

    @@ -1027,16 +1013,16 @@ RFC3164 uses BSD timeformat

    }); } /** - * send a RFC5424 formated message. Returns a promise with the formated + * send a RFC5424 formatted message. Returns a promise with the formatted * message that was sent. If no server connection was defined when the - * class was created a defualt Syslog connector will be used. + * class was created a default Syslog connector will be used. * @see SyslogPro~Syslog * @public - * @param {string} msg - The unformated Syslog message to send + * @param {string} msg - The unformatted Syslog message to send * @param {object} [options] - Options object * @param {number} [options.severity=7] - An array of structure * @param {number} [options.colorCode=36] - The ANSI color code to use if - * @returns {Promise} A Syslog formated string acording to the selected RFC + * @returns {Promise} A Syslog formatted string according to the selected RFC * @throws {Error} A standard error object */ send (msg, options) { @@ -1060,11 +1046,11 @@ RFC3164 uses BSD timeformat

    }); } /** - * Send a syslog message with a secerity level of 0 (Emergency) + * Send a syslog message with a security level of 0 (Emergency) * @public - * @param {string} msg - The emergancy message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @param {string} msg - The emergency message to send to the Syslog server + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ emergency (msg) { return this.send(msg, { @@ -1073,21 +1059,21 @@ RFC3164 uses BSD timeformat

    }); } /** - * Send a syslog message with a secerity level of 0 (Emergency) + * Send a syslog message with a security level of 0 (Emergency) * @public - * @param {string} msg - The emergancy message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @param {string} msg - The emergency message to send to the Syslog server + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ emer (msg) { return this.emergency(msg); } /** - * Send a syslog message with a secerity level of 1 (Alert) + * Send a syslog message with a severity level of 1 (Alert) * @public * @param {string} msg - The alert message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ alert (msg) { return this.send(msg, { @@ -1096,11 +1082,11 @@ RFC3164 uses BSD timeformat

    }); } /** - * Send a syslog message with a secerity level of 2 (Critical) + * Send a syslog message with a severity level of 2 (Critical) * @public * @param {string} msg - The critical message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ critical (msg) { return this.send(msg, { @@ -1109,21 +1095,21 @@ RFC3164 uses BSD timeformat

    }); } /** - * Send a syslog message with a secerity level of 2 (Critical) + * Send a syslog message with a severity level of 2 (Critical) * @public * @param {string} msg - The critical message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ crit (msg) { return this.critical(msg); } /** - * Send a syslog message with a secerity level of 3 (Error) + * Send a syslog message with a severity level of 3 (Error) * @public * @param {string} msg - The error message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ error (msg) { return this.send(msg, { @@ -1132,21 +1118,21 @@ RFC3164 uses BSD timeformat

    }); } /** - * Send a syslog message with a secerity level of 3 (Error) + * Send a syslog message with a severity level of 3 (Error) * @public * @param {string} msg - The error message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ err (msg) { return this.error(msg); } /** - * Send a syslog message with a secerity level of 4 (Warning) + * Send a syslog message with a severity level of 4 (Warning) * @public * @param {string} msg - The warning message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ warning (msg) { return this.send(msg, { @@ -1155,21 +1141,21 @@ RFC3164 uses BSD timeformat

    }); } /** - * Send a syslog message with a secerity level of 4 (Warning) + * Send a syslog message with a severity level of 4 (Warning) * @public * @param {string} msg - The warning message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ warn (msg) { return this.warning(msg); } /** - * Send a syslog message with a secerity level of 5 (Notice) + * Send a syslog message with a severity level of 5 (Notice) * @public * @param {string} msg - The notice message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ notice (msg) { return this.send(msg, { @@ -1178,21 +1164,21 @@ RFC3164 uses BSD timeformat

    }); } /** - * Send a syslog message with a secerity level of 5 (Notice) + * Send a syslog message with a severity level of 5 (Notice) * @public * @param {string} msg - The notice message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ note (msg) { return this.notice(msg); } /** - * Send a syslog message with a secerity level of 6 (Informational) + * Send a syslog message with a severity level of 6 (Informational) * @public * @param {string} msg - The informational message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ informational (msg) { return this.send(msg, { @@ -1201,31 +1187,31 @@ RFC3164 uses BSD timeformat

    }); } /** - * Send a syslog message with a secerity level of 6 (Informational) + * Send a syslog message with a severity level of 6 (Informational) * @public * @param {string} msg - The informational message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ info (msg) { return this.informational(msg); } /** - * Send a syslog message with a secerity level of 6 (Informational) + * Send a syslog message with a severity level of 6 (Informational) * @public * @param {string} msg - The informational message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ log (msg) { return this.informational(msg); } /** - * Send a syslog message with a secerity level of 7 (Debug) + * Send a syslog message with a severity level of 7 (Debug) * @public * @param {string} msg - The debug message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ debug (msg) { return this.send(msg, { @@ -1236,37 +1222,37 @@ RFC3164 uses BSD timeformat

    } /** - * A class to work with RFC5424 formated syslog messages. The meesaging is fully configurabule and Ansi foreground - * colors can be added. Both ANSI 8 and ANSI 256 color are fully suported. + * A class to work with RFC5424 formatted syslog messages. The messaging is fully configurable and ANSI foreground + * colors can be added. Both ANSI 8 and ANSI 256 color are fully supported. * Most APIs will return a promise. These APIs can be used using * `then(...)/catch(...)` * * A Syslog class with a configured - * Syslog server target can also be used as the input into the formating - * classes so that it may run independtly. + * Syslog server target can also be used as the input into the formatting + * classes so that it may run independently. * - * The RFC5424 Syslog logging format is ment to be used as a stream of log data - * from a service or applacation. This class is designed to be used in this - * fashion where new messages are writen to the class as needed. + * The RFC5424 Syslog logging format is meant to be used as a stream of log data + * from a service or application. This class is designed to be used in this + * fashion where new messages are written to the class as needed. * @requires moment * @version 0.0.0 * @since 0.0.0 */ class RFC5424 { /** - * Construct a new RFC5424 formated Syslog object with user options + * Construct a new RFC5424 formatted Syslog object with user options * @public * @this RFC5424 * @param {object} [options] - Options object - * @param {string} [options.applacationName='NodeJSLogger'] - Applacation + * @param {string} [options.applacationName='NodeJSLogger'] - Application * @param {string} [options.hostname=os.hostname] - The name of this server * @param {boolean} [options.timestamp=false] - Included a Timestamp - * @param {boolean} [options.timestampUTC=false] - RFC tandard is for + * @param {boolean} [options.timestampUTC=false] - RFC standard is for * local time * @param {boolean} [options.timestampMS=false] - Timestamp with ms - * resoltuion + * resolution * @param {boolean} [options.timestampTZ=true] - Should the timestamp - * included timezone + * included time zone * @param {boolean} [options.encludeStructuredData=false] - Included * any provided structured data * @param {boolean} [options.utf8BOM=true] - Included the UTF8 @@ -1274,7 +1260,7 @@ RFC3164 uses BSD timeformat

    * @param {boolean} [options.extendedColor=false] - Included the UTF8 * encoding tag with syslog message text * @param {object} [options.colors] - User defended colors for - * severites + * severities * @param {string} [options.colors.emergencyColor] - A RGB Hex coded color in the form * of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 * Extended) @@ -1566,7 +1552,7 @@ RFC3164 uses BSD timeformat

    }); } /** - * Building a formated message. Returns a promise with a formated message + * Building a formatted message. Returns a promise with a formatted message * @public * @param {string} msg - The Syslog Message * @param {object} [options] - Options object @@ -1577,12 +1563,12 @@ RFC3164 uses BSD timeformat

    * this message * @param {string[]} [options.structuredData] - An array of structure * data strings conforming to the IETF/IANA defined SD-IDs or IANA - * registred SMI Network Management Private Enterprise Code SD-ID + * registered SMI Network Management Private Enterprise Code SD-ID * conforming to the format * [name@<private enterprise number> parameter=value] * @param {number} [options.colorCode=36] - The ANSI color code to use if * message coloration is selected - * @returns {Promise} A Syslog formated string acording to the selected RFC + * @returns {Promise} A Syslog formatted string according to the selected RFC * @throws {Error} A standard error object */
    buildMessage (msg, options) { @@ -1609,11 +1595,11 @@ RFC3164 uses BSD timeformat

  • -
  • +
  • - +

    The PRI is common to both RFC formats

    @@ -1624,11 +1610,11 @@ RFC3164 uses BSD timeformat

  • -
  • +
  • - +

    Remove any newline character

    @@ -1639,11 +1625,11 @@ RFC3164 uses BSD timeformat

  • -
  • +
  • - +

    Add requested color

    @@ -1659,7 +1645,7 @@ RFC3164 uses BSD timeformat

    colorCode += options.msgColor; colorCode += 'm'; // ANSI Color Closer } else { - colorCode = '[39m'; // Use terminal's defualt color + colorCode = '[39m'; // Use terminal's default color } msg = escapeCode + colorCode + msg + resetColor; }
    @@ -1667,11 +1653,11 @@ RFC3164 uses BSD timeformat

  • -
  • +
  • - +

    RFC5424 timestamp formating

    @@ -1723,11 +1709,11 @@ RFC3164 uses BSD timeformat

  • -
  • +
  • - +

    Build Structured Data string

    @@ -1743,11 +1729,11 @@ RFC3164 uses BSD timeformat

  • -
  • +
  • - +

    Loop to drop duplicates of the same SD Element name

    @@ -1770,11 +1756,11 @@ RFC3164 uses BSD timeformat

  • -
  • +
  • - +

    Build the message

    @@ -1798,13 +1784,13 @@ RFC3164 uses BSD timeformat

    }); } /** - * send a RFC5424 formated message. Returns a promise with the formated + * send a RFC5424 formatted message. Returns a promise with the formatted * message that was sent. If no server connection was defined when the - * class was created a defualt Syslog connector will be used. + * class was created a default Syslog connector will be used. * @see SyslogPro~Syslog * @public - * @param {string} msg - The unformated Syslog message to send - * @returns {Promise} A Syslog formated string acording to the selected RFC + * @param {string} msg - The unformatted Syslog message to send + * @returns {Promise} A Syslog formatted string according to the selected RFC * @throws {Error} A standard error object */ send (msg, options) { @@ -1828,11 +1814,11 @@ RFC3164 uses BSD timeformat

    }); } /** - * Send a syslog message with a secerity level of 0 (Emergency) + * Send a syslog message with a severity level of 0 (Emergency) * @public - * @param {string} msg - The emergancy message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @param {string} msg - The emergency message to send to the Syslog server + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ emergency (msg) { return this.send(msg, { @@ -1841,21 +1827,21 @@ RFC3164 uses BSD timeformat

    }); } /** - * Send a syslog message with a secerity level of 0 (Emergency) + * Send a syslog message with a severity level of 0 (Emergency) * @public - * @param {string} msg - The emergancy message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @param {string} msg - The emergency message to send to the Syslog server + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ emer (msg) { return this.emergency(msg); } /** - * Send a syslog message with a secerity level of 1 (Alert) + * Send a syslog message with a severity level of 1 (Alert) * @public * @param {string} msg - The alert message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ alert (msg) { return this.send(msg, { @@ -1864,11 +1850,11 @@ RFC3164 uses BSD timeformat

    }); } /** - * Send a syslog message with a secerity level of 2 (Critical) + * Send a syslog message with a severity level of 2 (Critical) * @public * @param {string} msg - The critical message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ critical (msg) { return this.send(msg, { @@ -1877,21 +1863,21 @@ RFC3164 uses BSD timeformat

    }); } /** - * Send a syslog message with a secerity level of 2 (Critical) + * Send a syslog message with a severity level of 2 (Critical) * @public * @param {string} msg - The critical message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ crit (msg) { return this.critical(msg); } /** - * Send a syslog message with a secerity level of 3 (Error) + * Send a syslog message with a severity level of 3 (Error) * @public * @param {string} msg - The error message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ error (msg) { return this.send(msg, { @@ -1900,21 +1886,21 @@ RFC3164 uses BSD timeformat

    }); } /** - * Send a syslog message with a secerity level of 3 (Error) + * Send a syslog message with a severity level of 3 (Error) * @public * @param {string} msg - The error message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ err (msg) { return this.error(msg); } /** - * Send a syslog message with a secerity level of 4 (Warning) + * Send a syslog message with a severity level of 4 (Warning) * @public * @param {string} msg - The warning message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ warning (msg) { return this.send(msg, { @@ -1923,21 +1909,21 @@ RFC3164 uses BSD timeformat

    }); } /** - * Send a syslog message with a secerity level of 4 (Warning) + * Send a syslog message with a severity level of 4 (Warning) * @public * @param {string} msg - The warning message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ warn (msg) { return this.warning(msg); } /** - * Send a syslog message with a secerity level of 5 (Notice) + * Send a syslog message with a severity level of 5 (Notice) * @public * @param {string} msg - The notice message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ notice (msg) { return this.send(msg, { @@ -1946,21 +1932,21 @@ RFC3164 uses BSD timeformat

    }); } /** - * Send a syslog message with a secerity level of 5 (Notice) + * Send a syslog message with a severity level of 5 (Notice) * @public * @param {string} msg - The notice message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ note (msg) { return this.notice(msg); } /** - * Send a syslog message with a secerity level of 6 (Informational) + * Send a syslog message with a severity level of 6 (Informational) * @public * @param {string} msg - The informational message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ informational (msg) { return this.send(msg, { @@ -1969,31 +1955,31 @@ RFC3164 uses BSD timeformat

    }); } /** - * Send a syslog message with a secerity level of 6 (Informational) + * Send a syslog message with a severity level of 6 (Informational) * @public * @param {string} msg - The informational message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ info (msg) { return this.informational(msg); } /** - * Send a syslog message with a secerity level of 6 (Informational) + * Send a syslog message with a severity level of 6 (Informational) * @public * @param {string} msg - The informational message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ log (msg) { return this.informational(msg); } /** - * Send a syslog message with a secerity level of 7 (Debug) + * Send a syslog message with a severity level of 7 (Debug) * @public * @param {string} msg - The debug message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ debug (msg) { return this.send(msg, { @@ -2007,34 +1993,34 @@ RFC3164 uses BSD timeformat

    * A class to work with IBM LEEF (Log Event Extended Format) messages this form * of system messages are designed to work with security systems. Messages can * be saved to file (Saving to file if not part of this module but a LEEF - * formated mesage produced by this module can be saved externaly to it) or + * formatted message produced by this module can be saved externally to it) or * sent via Syslog. * Most APIs will return a promise. These APIs can be used using * `then(...)/catch(...)` * * A Syslog class with a configured Syslog server target can also be used as - * the input into the formating classes so that it may run independtly. The + * the input into the formatting classes so that it may run independently. The * LEEF format is designed to send event data to a SIEM system and should not - * be as a logging stream. This class is ment to be used once per message. + * be as a logging stream. This class is meant to be used once per message. * @requires moment * @version 0.0.0 * @since 0.0.0 */ class LEEF { /** - * Construct a new LEEF formating object with user options + * Construct a new LEEF formatting object with user options * @public * @param {object} [options] - Options object * @param {string} [options.vendor='unknown'] - The vendor of the system that - * genrated the event being reported + * generated the event being reported * @param {string} [options.product='unknown'] - The product name of the * system that genrated the event being reported * @param {string} [options.version='unknown'] - The version name of the * system that genrated the event being reported * @param {string} [options.eventId='unknown'] - The eventId of the * system that genrated the event being reported - * @param {object} [options.attrabute] - LEEF message attrabutes which - * defualts to all base attrabutes with null values, new attrabutes should + * @param {object} [options.attributes] - LEEF message attributes which + * defaults to all base attributes with null values, new attributes should * be added as new elements to this object * @param {boolean} [options.syslogHeader='true'] - Should the LEEF message * include a Syslog header with Timestamp and source @@ -2058,7 +2044,7 @@ RFC3164 uses BSD timeformat

    this.syslogHeader = typeof options.syslogHeader === 'boolean' ? options.syslogHeader : true; /** @type {object} */ - this.attrabutes = options.attrabutes || { + this.attributes = options.attributes || { cat: null, devTime: null, devTimeFormat: null, @@ -2116,9 +2102,9 @@ RFC3164 uses BSD timeformat

    } } /** - *Build a formated message + *Build a formatted message * @public - * @return {Promise} - string with formated message + * @return {Promise} - string with formatted message */ buildMessage () { return new Promise((resolve, reject) => { @@ -2132,18 +2118,18 @@ RFC3164 uses BSD timeformat

  • -
  • +
  • - +
    -

    Build LEEF Attrabuites

    +

    Build LEEF Attributes

          const Tab = '\x09';
    -      const leefAttribs = Object.entries(this.attrabutes);
    +      const leefAttribs = Object.entries(this.attributes);
           const leefAttribsLen = leefAttribs.length;
           for (let attrib = 0; attrib < leefAttribsLen; attrib++) {
             if (leefAttribs[attrib][1] !== null) {
    @@ -2183,36 +2169,36 @@ RFC3164 uses BSD timeformat

    * A class to work with HP CEF (Common Event Format) messages. This form * of system messages are designed to work with security systems. Messages can * be saved to file (Saving to file if not part of this module but a CEF - * formated mesage produced by this module can be saved externaly to it) or + * formatted message produced by this module can be saved externally to it) or * sent via Syslog. * Most APIs will return a promise. These APIs can be used using * `then(...)/catch(...)` * * A Syslog class with a configured Syslog server target can also be used as - * the input into the formating classes so that it may run independtly. The CEF + * the input into the formatting classes so that it may run independently. The CEF * format is designed to send event data to a SIEM system and should not be as - * a logging stream. This class is ment to be used once per message. + * a logging stream. This class is meant to be used once per message. * @requires moment * @version 0.0.0 * @since 0.0.0 */ class CEF { /** - * Construct a new CEF formating object with user options + * Construct a new CEF formatting object with user options * @public * @param {object} [options] - Options object * @param {string} [options.deviceVendor='unknown'] - The vendor of the system - * that genrated the event being reported + * that generated the event being reported * @param {string} [options.deviceProduct='unknown'] - The product name of the * system that genrated the event being reported * @param {string} [options.deviceVersion='unknown'] - The version name of the * system that genrated the event being reported * @param {string} [options.deviceEventClassId='unknown'] - The eventId of the * system that genrated the event being reported - * @param {string} [options.name='unknown'] - Name of the service genrating + * @param {string} [options.name='unknown'] - Name of the service generating * the notice * @param {string} [options.severity='unknown'] - Severity of the notification - * @param {string} [options.extensions={}] - Any CEF Key=Value extentions + * @param {string} [options.extensions={}] - Any CEF Key=Value extensions * @param {Syslog} [options.server=false] - A {@link module:SyslogPro~Syslog| * Syslog server connection} that should be used to send messages directly * from this class. @see SyslogPro~Syslog @@ -2405,8 +2391,8 @@ RFC3164 uses BSD timeformat

    /** * Validate this CEF object * @public - * @return {Promise} - True if valadated - * @throws {Error} - First element to fail valadation + * @return {Promise} - True if validated + * @throws {Error} - First element to fail validation */ validate () { return new Promise ((resolve, reject) => { diff --git a/docs/index.html b/docs/index.html index 8183c56..0eabb2b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -81,8 +81,8 @@ and the DNS Promi protocol: 'udp', format: 'rfc5424' }); - syslog.rfc5424.info('My Message');

    Optionaly you can create each class or class options to pass to SyslogPro - to create formated messages or use directly

    + 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({
         applacationName: 'MyApp',
    @@ -142,7 +142,9 @@ and the DNS Promi
               });

    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.

    @@ -165,7 +167,7 @@ changed functionality. Lint and test your code.


    - Documentation generated by JSDoc 3.5.5 on Tue Sep 25 2018 18:22:00 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Sep 25 2018 19:11:53 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/docs/index.js.html b/docs/index.js.html index a363064..acc93fc 100644 --- a/docs/index.js.html +++ b/docs/index.js.html @@ -41,17 +41,18 @@
    -
    /** Copyright (c) 2018 Craig Yamato */
    +            
    // INDEX.JS
    +/** Copyright (c) 2018 Craig Yamato */
     
     /**
      * @fileoverview The SyslogPro module for sending syslog messages
      * Most APIs will return a promise. These APIs can be used using 
      * `then(...)/catch(...)`
      *
    - * Syslog formating classes can be used as input into a Syslog class to be used 
    - * simultatniusly to the same Syslog server.  The Syslog Class with a configured
    - * Syslog server target can also be used as the input into each of the formating 
    - * classes so that they may run independtly.
    + * Syslog formatting classes can be used as input into a Syslog class to be used 
    + * simultaneously to the same Syslog server.  The Syslog Class with a configured
    + * Syslog server target can also be used as the input into each of the formatting 
    + * classes so that they may run independently.
      * @author Craig Yamato <craig@kentik.com>
      * @copyright (c) 2018 - Craig Yamato
      * @version 0.1.0
    @@ -72,7 +73,7 @@ const fs = require("fs");
      * @private
      * @param {string} hex - The color hex code in the form of #FFFFFF or Number of
      *     the ANSI color code (30-37 Standard & 0-255 Extended)
    - * @returns {Promise} - The formated ANSI color code
    + * @returns {Promise} - The formatted ANSI color code
      * @throws {Error} - A Format Error
      */
     function rgbToAnsi (hex, extendedColor) {
    @@ -137,11 +138,11 @@ function rgbToAnsi (hex, extendedColor) {
     
     /**
      * A class to work with syslog messages using UDP, TCP, or TLS transport.  
    - * There is suport for Syslog message formating RFC-3164, RFC-5424 including 
    + * There is support for Syslog message formatting RFC-3164, RFC-5424 including 
      * Structured Data, IBM LEEF (Log Event Extended Format), and HP CEF (Common
      * Event Format).
    - * Syslog formating classes can be used as input into a Syslog class to be used 
    - * simultatniusly to the same Syslog server. * 
    + * Syslog formatting classes can be used as input into a Syslog class to be used 
    + * simultaneously to the same Syslog server. * 
      * @requires moment
      * @version 0.0.0
      * @since 0.0.0
    @@ -154,27 +155,27 @@ class Syslog {
        * @since 0.0.0
        * @this Syslog
        * @param {object} [options] - Options object
    -   * >>>Transport Configuraton
    +   * >>>Transport Configuration
        * @param {string} [options.target='localhost'] - The IP Address|FQDN of the 
    -   *    Syslog Server, this option if set will take prasdents over any target 
    -   *    set in a formating object
    -   * @param {string} [options.protocol='udp'] - L4 transport portocol 
    -   *    (udp|tcp|tls), this option if set will take prasdents over any transport 
    -   *    set in a formating object
    +   *    Syslog Server, this option if set will take presidents over any target 
    +   *    set in a formatting object
    +   * @param {string} [options.protocol='udp'] - L4 transport protocol 
    +   *    (udp|tcp|tls), this option if set will take presidents over any transport 
    +   *    set in a formatting object
        * @param {number} [options.port=514] - IP port, this option if set will take 
    -   *    prasdents over any IP Port set in a formating object
    +   *    presidents over any IP Port set in a formatting object
        * @param {number} [options.tcpTimeout=10000] - Ignored for all other 
    -   *    transports, this option if set will take prasdents over any timeout 
    -   *    set in a formating object
    -   * @param {string[]} [options.tlsServerCerts] - Array of authrized TLS server
    -   *    certificates file locations, this option if set will take prasdents 
    -   *    over any certificates set in a formating object
    +   *    transports, this option if set will take presidents over any timeout 
    +   *    set in a formatting object
    +   * @param {string[]} [options.tlsServerCerts] - Array of authorized TLS server
    +   *    certificates file locations, this option if set will take presidents 
    +   *    over any certificates set in a formatting object
        * @param {string} [options.tlsClientCert] - Client TLS certificate file 
        *    location that this client should use, this option if set will take 
    -   *    prasdents over any certificates set in a formating object
    +   *    presidents over any certificates set in a formatting object
        * @param {string} [options.tlsClientKey] - Client TLS key file 
        *    location that this client should use, this option if set will take 
    -   *    prasdents over any certificates set in a formating object
    +   *    presidents over any certificates set in a formatting object
        * >>>Syslog Format Settings
        * @param {string} [options.format='none'] - Valid syslog format options for 
        *    this module are 'none', 'rfc3164', 'rfc5424', 'leef', 'cef'
    @@ -185,7 +186,7 @@ class Syslog {
        * @param {LEEF} [options.leef] - {@link module:SyslogPro~LEEF|IBM LEEF 
        *    (Log Event Extended Format) object} 
        * @param {CEF} [options.cef] - {@link module:SyslogPro~CEF|HP CEF 
    -   *    (Common Event Format) formating object} 
    +   *    (Common Event Format) formatting object} 
        */
       constructor (options) {
         this.constructor__ = true;
    @@ -272,9 +273,9 @@ class Syslog {
       }
       
       /**
    -   * Add a TLS server certificate which can be used to authentacat the server 
    -   * this syslog client is connecting too.  This function will valadate the
    -   * input as a file location straing and add it to an array of certificates
    +   * Add a TLS server certificate which can be used to authenticate the server 
    +   * this syslog client is connecting too.  This function will validate the
    +   * input as a file location string and add it to an array of certificates
        * @private
        * @version 0.0.0
        * @since 0.0.0
    @@ -290,7 +291,7 @@ class Syslog {
           } else if (typeof certs === 'string') {
             this.tlsServerCerts = [certs];
           } else {
    -        let errMsg = 'TYPE ERROR: Server Cert file loctions shoudl be a string';
    +        let errMsg = 'TYPE ERROR: Server Cert file locations should be a string';
             errMsg += ' or array of strings';
             reject(new Error(errMsg));
           }
    @@ -300,8 +301,8 @@ class Syslog {
       /**
        * Send the Syslog message over UDP
        * @private
    -   * @param {string} msg - The formated Syslog Message
    -   * @returns {Promise} - The Syslog formated string sent
    +   * @param {string} msg - The formatted Syslog Message
    +   * @returns {Promise} - The Syslog formatted string sent
        * @throws {Error} - Network Error
        */
       udpMessage (msg) {
    @@ -329,8 +330,8 @@ class Syslog {
       /**
        * Send the Syslog message over TCP
        * @private
    -   * @param {string} msg - The formated Syslog Message
    -   * @returns {Promise} - The Syslog formated string sent
    +   * @param {string} msg - The formatted Syslog Message
    +   * @returns {Promise} - The Syslog formatted string sent
        * @throws {Error} - Timeout error for TCP and TLS connections
        * @throws {Error} - Network Error
        */
    @@ -375,8 +376,8 @@ class Syslog {
       /**
        * Send the Syslog message over TLS
        * @private
    -   * @param {string} msg - The formated Syslog Message
    -   * @returns {Promise} - The Syslog formated string sent
    +   * @param {string} msg - The formatted Syslog Message
    +   * @returns {Promise} - The Syslog formatted string sent
        * @throws {Error} - Timeout error for TCP and TLS connections
        * @throws {Error} - Network Error
        */
    @@ -421,7 +422,7 @@ class Syslog {
             tlsOptions.ca = tlsOptionsCerts;
             tlsOptions.rejectUnauthorized = true;
           }
    -      const client = tls.connect(tlsOptions, () => { 
    +      const client = tls.connect(tlsOptions, () => {
             // Turn msg in to a UTF8 buffer
             let msgBuffer = Buffer.from(msg, 'utf8');
             client.write(msgBuffer, () => {
    @@ -429,7 +430,6 @@ class Syslog {
             });
           });
           client.setTimeout(this.tcpTimeout);
    -      // client.on('data', (data) => {});
           client.on('end', () => {
             resolve(msg);
           });
    @@ -447,8 +447,8 @@ class Syslog {
        * Send the Syslog message to the selected target Syslog server using the 
        * selected transport.
        * @private
    -   * @param {string} msg - The formated Syslog Message
    -   * @returns {Promise} - The Syslog formated string sent
    +   * @param {string} msg - The formatted Syslog Message
    +   * @returns {Promise} - The Syslog formatted string sent
        * @throws {Error} - Timeout error for TCP and TLS connections
        * @throws {Error} - Network Error
        */
    @@ -484,7 +484,7 @@ class Syslog {
                   reject(reson);
                 });
           } else {
    -        let errorMsg = 'FORMAT ERROR: Protocol not reconized, should be ';
    +        let errorMsg = 'FORMAT ERROR: Protocol not recognized, should be ';
             errorMsg += 'udp|tcp|tls';
             reject(new Error(errorMsg));
           }
    @@ -493,38 +493,38 @@ class Syslog {
     }
      
     /**
    - * A class to work with RFC3164 formated syslog messages. The meesaging is fully configurabule and Ansi foreground 
    - * colors can be added.  Both ANSI 8 and ANSI 256 color are fully suported.
    + * A class to work with RFC3164 formatted syslog messages. The messaging is fully configurable and ANSI foreground 
    + * colors can be added.  Both ANSI 8 and ANSI 256 color are fully supported.
      * Most APIs will return a promise. These APIs can be used using 
      * `then(...)/catch(...)`
      * 
      * A Syslog class with a configured
    - * Syslog server target can also be used as the input into the formating 
    - * classes so that it may run independtly.
    + * Syslog server target can also be used as the input into the formatting 
    + * classes so that it may run independently.
      * 
    - * The RFC3164 Syslog logging format is ment to be used as a stream of log data 
    - * from a service or applacation. This class is designed to be used in this
    - * fashion where new messages are writen to the class as needed.
    + * The RFC3164 Syslog logging format is meant to be used as a stream of log data 
    + * from a service or application. This class is designed to be used in this
    + * fashion where new messages are written to the class as needed.
      * @requires moment
      * @version 0.0.0
      * @since 0.0.0
      */
     class RFC3164 {
       /**
    -   * Construct a new RFC3164 formated Syslog object with user options 
    +   * Construct a new RFC3164 formatted Syslog object with user options 
        * @public
        * @this RFC3164
        * @param {object} [options] - Options object
    -   * @param {string} [options.applacationName='NodeJSLogger'] - Applacation
    +   * @param {string} [options.applacationName='NodeJSLogger'] - Application
        * @param {string} [options.hostname=os.hostname] - The name of this server
        * @param {number} [options.facility=23] - Facility code to use sending this 
        *    message 
        * @param {boolean} [options.color=false] - Apply color coding encoding tag 
        *    with syslog message text 
    -   * @param {boolean} [options.extendedColor=false] - Use the extedned ANSI 
    +   * @param {boolean} [options.extendedColor=false] - Use the extended ANSI 
        *    color set encoding tag with syslog message text 
        * @param {object} [options.colors] - User defended colors for 
    -   *    severites
    +   *    severities
        * @param {string} [options.colors.emergencyColor] - A RGB Hex coded color in the form 
        *    of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 
        *    Extended)
    @@ -781,14 +781,14 @@ class RFC3164 {
         });
       }
       /**
    -   * Building a formated message.  Returns a promise with a formated message 
    +   * Building a formatted message.  Returns a promise with a formatted message 
        * @public
        * @param {string} msg - The Syslog Message
        * @param {object} [options] - Options object
        * @param {number} [options.severity=7] - An array of structure 
        * @param {number} [options.colorCode=36] - The ANSI color code to use if 
        *    message coloration is selected
    -   * @returns {Promise} A Syslog formated string acording to the selected RFC
    +   * @returns {Promise} A Syslog formatted string according to the selected RFC
        * @throws {Error} A standard error object
        */
       buildMessage (msg, options) {
    @@ -802,7 +802,7 @@ class RFC3164 {
             reject(new Error(errMsg));
             return;
           }
    -      let fmtMsg = ''; // Formated Syslog message string var
    +      let fmtMsg = ''; // Formatted Syslog message string var
           const newLine = '\n';
           const newLineRegEx = /(\r|\n|(\r\n))/;
           const escapeCode = '\u001B';
    @@ -810,7 +810,7 @@ class RFC3164 {
           // The PRI is common to both RFC formats
           const pri = (this.facility * 8) + severity;
           // Remove any newline character
    -      msg = msg.replace(newLineRegEx, ''); 
    +      msg = msg.replace(newLineRegEx, '');
           // Add requested color
           if (this.color) {
             options.msgColor = options.msgColor || 36;
    @@ -822,17 +822,16 @@ class RFC3164 {
               colorCode += options.msgColor;
               colorCode += 'm'; // ANSI Color Closer
             } else {
    -          colorCode = '[39m';  // Use terminal's defualt color
    +          colorCode = '[39m';  // Use terminal's default color
             }
             msg = escapeCode + colorCode + msg + resetColor;
           }
    -      // RegEx to find a leading 0 in the day of a DateTime for RFC3164
    -      // RFC3164 uses BSD timeformat
    +      // RegEx to find a leading 0 in the day of a DateTime for RFC3164 RFC3164 uses BSD timeformat
           const rfc3164DateRegEx = /((A|D|F|J|M|N|O|S)(a|c|e|p|o|u)(b|c|g|l|n|p|r|t|v|y)\s)0(\d\s\d\d:\d\d:\d\d)/;
           const timestamp = moment()
               .format('MMM DD hh:mm:ss')
               .replace(rfc3164DateRegEx, '$1 $5');
    -      // Build message    
    +      // Build message
           fmtMsg = '<' + pri + '>';
           fmtMsg += timestamp;
           fmtMsg += ' ' + this.hostname;
    @@ -843,16 +842,16 @@ class RFC3164 {
         });
       }
       /**
    -   * send a RFC5424 formated message.  Returns a promise with the formated 
    +   * send a RFC5424 formatted message.  Returns a promise with the formatted 
        *    message that was sent.  If no server connection was defined when the 
    -   *    class was created a defualt Syslog connector will be used.  
    +   *    class was created a default Syslog connector will be used.  
        *    @see SyslogPro~Syslog
        * @public
    -   * @param {string} msg - The unformated Syslog message to send
    +   * @param {string} msg - The unformatted Syslog message to send
        * @param {object} [options] - Options object
        * @param {number} [options.severity=7] - An array of structure 
        * @param {number} [options.colorCode=36] - The ANSI color code to use if 
    -   * @returns {Promise} A Syslog formated string acording to the selected RFC
    +   * @returns {Promise} A Syslog formatted string according to the selected RFC
        * @throws {Error} A standard error object
        */
       send (msg, options) {
    @@ -876,11 +875,11 @@ class RFC3164 {
         });
       } 
       /**
    -   * Send a syslog message with a secerity level of 0 (Emergency)
    +   * Send a syslog message with a security level of 0 (Emergency)
        * @public
    -   * @param {string} msg - The emergancy message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @param {string} msg - The emergency message to send to the Syslog server
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       emergency (msg) {
         return this.send(msg, {
    @@ -889,21 +888,21 @@ class RFC3164 {
         });
       }
       /**
    -   * Send a syslog message with a secerity level of 0 (Emergency)
    +   * Send a syslog message with a security level of 0 (Emergency)
        * @public
    -   * @param {string} msg - The emergancy message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @param {string} msg - The emergency message to send to the Syslog server
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       emer (msg) {
         return this.emergency(msg);
       }
       /**
    -   * Send a syslog message with a secerity level of 1 (Alert)
    +   * Send a syslog message with a severity level of 1 (Alert)
        * @public
        * @param {string} msg - The alert message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       alert (msg) {
         return this.send(msg, {
    @@ -912,11 +911,11 @@ class RFC3164 {
         });
       }
       /**
    -   * Send a syslog message with a secerity level of 2 (Critical)
    +   * Send a syslog message with a severity level of 2 (Critical)
        * @public
        * @param {string} msg - The critical message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       critical (msg) {
         return this.send(msg, {
    @@ -925,21 +924,21 @@ class RFC3164 {
         });
       }
       /**
    -   * Send a syslog message with a secerity level of 2 (Critical)
    +   * Send a syslog message with a severity level of 2 (Critical)
        * @public
        * @param {string} msg - The critical message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       crit (msg) {
         return this.critical(msg);
       }
       /**
    -   * Send a syslog message with a secerity level of 3 (Error)
    +   * Send a syslog message with a severity level of 3 (Error)
        * @public
        * @param {string} msg - The error message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       error (msg) {
         return this.send(msg, {
    @@ -948,21 +947,21 @@ class RFC3164 {
         });
       }
       /**
    -   * Send a syslog message with a secerity level of 3 (Error)
    +   * Send a syslog message with a severity level of 3 (Error)
        * @public
        * @param {string} msg - The error message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       err (msg) {
         return this.error(msg);
       }
       /**
    -   * Send a syslog message with a secerity level of 4 (Warning)
    +   * Send a syslog message with a severity level of 4 (Warning)
        * @public
        * @param {string} msg - The warning message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       warning (msg) {
         return this.send(msg, {
    @@ -971,21 +970,21 @@ class RFC3164 {
         });
       }
       /**
    -   * Send a syslog message with a secerity level of 4 (Warning)
    +   * Send a syslog message with a severity level of 4 (Warning)
        * @public
        * @param {string} msg - The warning message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       warn (msg) {
         return this.warning(msg);
       }
       /**
    -   * Send a syslog message with a secerity level of 5 (Notice)
    +   * Send a syslog message with a severity level of 5 (Notice)
        * @public
        * @param {string} msg - The notice message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       notice (msg) {
         return this.send(msg, {
    @@ -994,21 +993,21 @@ class RFC3164 {
         });
       }
       /**
    -   * Send a syslog message with a secerity level of 5 (Notice)
    +   * Send a syslog message with a severity level of 5 (Notice)
        * @public
        * @param {string} msg - The notice message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       note (msg) {
         return this.notice(msg);
       }
       /**
    -   * Send a syslog message with a secerity level of 6 (Informational)
    +   * Send a syslog message with a severity level of 6 (Informational)
        * @public
        * @param {string} msg - The informational message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       informational (msg) {
         return this.send(msg, {
    @@ -1017,31 +1016,31 @@ class RFC3164 {
         });
       }
       /**
    -   * Send a syslog message with a secerity level of 6 (Informational)
    +   * Send a syslog message with a severity level of 6 (Informational)
        * @public
        * @param {string} msg - The informational message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       info (msg) {
         return this.informational(msg);
       }
       /**
    -   * Send a syslog message with a secerity level of 6 (Informational)
    +   * Send a syslog message with a severity level of 6 (Informational)
        * @public
        * @param {string} msg - The informational message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       log (msg) {
         return this.informational(msg);
       }
       /**
    -   * Send a syslog message with a secerity level of 7 (Debug)
    +   * Send a syslog message with a severity level of 7 (Debug)
        * @public
        * @param {string} msg - The debug message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       debug (msg) {
         return this.send(msg, {
    @@ -1052,37 +1051,37 @@ class RFC3164 {
     }
     
     /**
    - * A class to work with RFC5424 formated syslog messages. The meesaging is fully configurabule and Ansi foreground 
    - * colors can be added.  Both ANSI 8 and ANSI 256 color are fully suported.
    + * A class to work with RFC5424 formatted syslog messages. The messaging is fully configurable and ANSI foreground 
    + * colors can be added.  Both ANSI 8 and ANSI 256 color are fully supported.
      * Most APIs will return a promise. These APIs can be used using 
      * `then(...)/catch(...)`
      * 
      * A Syslog class with a configured
    - * Syslog server target can also be used as the input into the formating 
    - * classes so that it may run independtly.
    + * Syslog server target can also be used as the input into the formatting 
    + * classes so that it may run independently.
      * 
    - * The RFC5424 Syslog logging format is ment to be used as a stream of log data 
    - * from a service or applacation. This class is designed to be used in this
    - * fashion where new messages are writen to the class as needed.
    + * The RFC5424 Syslog logging format is meant to be used as a stream of log data 
    + * from a service or application. This class is designed to be used in this
    + * fashion where new messages are written to the class as needed.
      * @requires moment
      * @version 0.0.0
      * @since 0.0.0
      */
     class RFC5424 {
       /**
    -   * Construct a new RFC5424 formated Syslog object with user options 
    +   * Construct a new RFC5424 formatted Syslog object with user options 
        * @public
        * @this RFC5424
        * @param {object} [options] - Options object
    -   * @param {string} [options.applacationName='NodeJSLogger'] - Applacation
    +   * @param {string} [options.applacationName='NodeJSLogger'] - Application
        * @param {string} [options.hostname=os.hostname] - The name of this server
        * @param {boolean} [options.timestamp=false] - Included a Timestamp
    -   * @param {boolean} [options.timestampUTC=false] - RFC tandard is for 
    +   * @param {boolean} [options.timestampUTC=false] - RFC standard is for 
        *    local time
        * @param {boolean} [options.timestampMS=false] - Timestamp with ms 
    -   *    resoltuion
    +   *    resolution
        * @param {boolean} [options.timestampTZ=true] - Should the timestamp
    -   *    included timezone
    +   *    included time zone
        * @param {boolean} [options.encludeStructuredData=false] - Included 
        *    any provided structured data
        * @param {boolean} [options.utf8BOM=true] - Included the UTF8 
    @@ -1090,7 +1089,7 @@ class RFC5424 {
        * @param {boolean} [options.extendedColor=false] - Included the UTF8 
        *    encoding tag with syslog message text 
        * @param {object} [options.colors] - User defended colors for 
    -   *    severites
    +   *    severities
        * @param {string} [options.colors.emergencyColor] - A RGB Hex coded color in the form 
        *    of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 
        *    Extended)
    @@ -1382,7 +1381,7 @@ class RFC5424 {
         });
       }
       /**
    -   * Building a formated message.  Returns a promise with a formated message 
    +   * Building a formatted message.  Returns a promise with a formatted message 
        * @public
        * @param {string} msg - The Syslog Message
        * @param {object} [options] - Options object
    @@ -1393,12 +1392,12 @@ class RFC5424 {
        *    this message 
        * @param {string[]} [options.structuredData] - An array of structure 
        *    data strings conforming to the IETF/IANA defined SD-IDs or IANA 
    -   *    registred SMI Network Management Private Enterprise Code SD-ID 
    +   *    registered SMI Network Management Private Enterprise Code SD-ID 
        *    conforming to the format 
        *    [name@<private enterprise number> parameter=value] 
        * @param {number} [options.colorCode=36] - The ANSI color code to use if 
        *    message coloration is selected
    -   * @returns {Promise} A Syslog formated string acording to the selected RFC
    +   * @returns {Promise} A Syslog formatted string according to the selected RFC
        * @throws {Error} A standard error object
        */
       buildMessage (msg, options) {
    @@ -1424,7 +1423,7 @@ class RFC5424 {
           // The PRI is common to both RFC formats
           const pri = (facility * 8) + severity;
           // Remove any newline character
    -      msg = msg.replace(newLineRegEx, ''); 
    +      msg = msg.replace(newLineRegEx, '');
           // Add requested color
           if (this.color) {
             options.msgColor = options.msgColor || 36;
    @@ -1436,7 +1435,7 @@ class RFC5424 {
               colorCode += options.msgColor;
               colorCode += 'm'; // ANSI Color Closer
             } else {
    -          colorCode = '[39m';  // Use terminal's defualt color
    +          colorCode = '[39m';  // Use terminal's default color
             }
             msg = escapeCode + colorCode + msg + resetColor;
           }
    @@ -1483,7 +1482,7 @@ class RFC5424 {
             timeQuality += ']';
             msgStructuredData.push(timeQuality);
           }
    -      // Build Structured Data string
    +      //Build Structured Data string
           let structuredData = '-';
           const sdElementCount = msgStructuredData.length;
           if (this.encludeStructuredData && sdElementCount > 0) {
    @@ -1523,13 +1522,13 @@ class RFC5424 {
         });
       }
       /**
    -   * send a RFC5424 formated message.  Returns a promise with the formated 
    +   * send a RFC5424 formatted message.  Returns a promise with the formatted 
        *    message that was sent.  If no server connection was defined when the 
    -   *    class was created a defualt Syslog connector will be used.  
    +   *    class was created a default Syslog connector will be used.  
        *    @see SyslogPro~Syslog
        * @public
    -   * @param {string} msg - The unformated Syslog message to send
    -   * @returns {Promise} A Syslog formated string acording to the selected RFC
    +   * @param {string} msg - The unformatted Syslog message to send
    +   * @returns {Promise} A Syslog formatted string according to the selected RFC
        * @throws {Error} A standard error object
        */
       send (msg, options) {
    @@ -1553,11 +1552,11 @@ class RFC5424 {
         });
       }
       /**
    -   * Send a syslog message with a secerity level of 0 (Emergency)
    +   * Send a syslog message with a severity level of 0 (Emergency)
        * @public
    -   * @param {string} msg - The emergancy message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @param {string} msg - The emergency message to send to the Syslog server
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       emergency (msg) {
         return this.send(msg, {
    @@ -1566,21 +1565,21 @@ class RFC5424 {
         });
       }
       /**
    -   * Send a syslog message with a secerity level of 0 (Emergency)
    +   * Send a syslog message with a severity level of 0 (Emergency)
        * @public
    -   * @param {string} msg - The emergancy message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @param {string} msg - The emergency message to send to the Syslog server
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       emer (msg) {
         return this.emergency(msg);
       }
       /**
    -   * Send a syslog message with a secerity level of 1 (Alert)
    +   * Send a syslog message with a severity level of 1 (Alert)
        * @public
        * @param {string} msg - The alert message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       alert (msg) {
         return this.send(msg, {
    @@ -1589,11 +1588,11 @@ class RFC5424 {
         });
       }
       /**
    -   * Send a syslog message with a secerity level of 2 (Critical)
    +   * Send a syslog message with a severity level of 2 (Critical)
        * @public
        * @param {string} msg - The critical message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       critical (msg) {
         return this.send(msg, {
    @@ -1602,21 +1601,21 @@ class RFC5424 {
         });
       }
       /**
    -   * Send a syslog message with a secerity level of 2 (Critical)
    +   * Send a syslog message with a severity level of 2 (Critical)
        * @public
        * @param {string} msg - The critical message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       crit (msg) {
         return this.critical(msg);
       }
       /**
    -   * Send a syslog message with a secerity level of 3 (Error)
    +   * Send a syslog message with a severity level of 3 (Error)
        * @public
        * @param {string} msg - The error message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       error (msg) {
         return this.send(msg, {
    @@ -1625,21 +1624,21 @@ class RFC5424 {
         });
       }
       /**
    -   * Send a syslog message with a secerity level of 3 (Error)
    +   * Send a syslog message with a severity level of 3 (Error)
        * @public
        * @param {string} msg - The error message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       err (msg) {
         return this.error(msg);
       }
       /**
    -   * Send a syslog message with a secerity level of 4 (Warning)
    +   * Send a syslog message with a severity level of 4 (Warning)
        * @public
        * @param {string} msg - The warning message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       warning (msg) {
         return this.send(msg, {
    @@ -1648,21 +1647,21 @@ class RFC5424 {
         });
       }
       /**
    -   * Send a syslog message with a secerity level of 4 (Warning)
    +   * Send a syslog message with a severity level of 4 (Warning)
        * @public
        * @param {string} msg - The warning message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       warn (msg) {
         return this.warning(msg);
       }
       /**
    -   * Send a syslog message with a secerity level of 5 (Notice)
    +   * Send a syslog message with a severity level of 5 (Notice)
        * @public
        * @param {string} msg - The notice message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       notice (msg) {
         return this.send(msg, {
    @@ -1671,21 +1670,21 @@ class RFC5424 {
         });
       }
       /**
    -   * Send a syslog message with a secerity level of 5 (Notice)
    +   * Send a syslog message with a severity level of 5 (Notice)
        * @public
        * @param {string} msg - The notice message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       note (msg) {
         return this.notice(msg);
       }
       /**
    -   * Send a syslog message with a secerity level of 6 (Informational)
    +   * Send a syslog message with a severity level of 6 (Informational)
        * @public
        * @param {string} msg - The informational message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       informational (msg) {
         return this.send(msg, {
    @@ -1694,31 +1693,31 @@ class RFC5424 {
         });
       }
       /**
    -   * Send a syslog message with a secerity level of 6 (Informational)
    +   * Send a syslog message with a severity level of 6 (Informational)
        * @public
        * @param {string} msg - The informational message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       info (msg) {
         return this.informational(msg);
       }
       /**
    -   * Send a syslog message with a secerity level of 6 (Informational)
    +   * Send a syslog message with a severity level of 6 (Informational)
        * @public
        * @param {string} msg - The informational message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       log (msg) {
         return this.informational(msg);
       }
       /**
    -   * Send a syslog message with a secerity level of 7 (Debug)
    +   * Send a syslog message with a severity level of 7 (Debug)
        * @public
        * @param {string} msg - The debug message to send to the Syslog server
    -   * @returns {Promise} - The formated syslog message sent to the Syslog server
    -   * @throws {Error} - Any bubbled up error
    +   * @returns {Promise} - The formatted syslog message sent to the Syslog server
    +   * @throws {Error} - Any bubbled-up error
        */
       debug (msg) {
         return this.send(msg, {
    @@ -1732,34 +1731,34 @@ class RFC5424 {
      * A class to work with IBM LEEF (Log Event Extended Format) messages this form
      * of system messages are designed to work with security systems.  Messages can
      * be saved to file (Saving to file if not part of this module but a LEEF 
    - * formated mesage produced by this module can be saved externaly to it) or 
    + * formatted message produced by this module can be saved externally to it) or 
      * sent via Syslog. 
      * Most APIs will return a promise. These APIs can be used using 
      * `then(...)/catch(...)`
      * 
      * A Syslog class with a configured Syslog server target can also be used as 
    - * the input into the formating classes so that it may run independtly. The 
    + * the input into the formatting classes so that it may run independently. The 
      * LEEF format is designed to send event data to a SIEM system and should not 
    - * be as a logging stream. This class is ment to be used once per message.
    + * be as a logging stream. This class is meant to be used once per message.
      * @requires moment
      * @version 0.0.0
      * @since 0.0.0
      */
     class LEEF {
       /**
    -   * Construct a new LEEF formating object with user options
    +   * Construct a new LEEF formatting object with user options
        * @public
        * @param {object} [options] - Options object
        * @param {string} [options.vendor='unknown'] - The vendor of the system that
    -   *    genrated the event being reported
    +   *    generated the event being reported
        * @param {string} [options.product='unknown'] - The product name of the 
        *    system that genrated the event being reported
        * @param {string} [options.version='unknown'] - The version name of the 
        *    system that genrated the event being reported
        * @param {string} [options.eventId='unknown'] - The eventId of the 
        *    system that genrated the event being reported
    -   * @param {object} [options.attrabute] - LEEF message attrabutes which 
    -   *    defualts to all base attrabutes with null values, new attrabutes should
    +   * @param {object} [options.attributes] - LEEF message attributes which 
    +   *    defaults to all base attributes with null values, new attributes should
        *    be added as new elements to this object
        * @param {boolean} [options.syslogHeader='true'] - Should the LEEF message 
        *    include a Syslog header with Timestamp and source
    @@ -1783,7 +1782,7 @@ class LEEF {
         this.syslogHeader = typeof options.syslogHeader === 'boolean' 
             ? options.syslogHeader : true;
         /** @type {object} */
    -    this.attrabutes = options.attrabutes || {
    +    this.attributes = options.attributes || {
           cat: null,
           devTime: null,
           devTimeFormat: null,
    @@ -1841,9 +1840,9 @@ class LEEF {
         }
       }
       /**
    -   *Build a formated message
    +   *Build a formatted message
        * @public
    -   * @return {Promise} - string with formated message
    +   * @return {Promise} - string with formatted message
        */
       buildMessage () {
         return new Promise((resolve, reject) => {
    @@ -1854,9 +1853,9 @@ class LEEF {
           fmtMsg += '|' + this.eventId;
           fmtMsg += '|';
           
    -      // Build LEEF Attrabuites
    +      // Build LEEF Attributes
           const Tab = '\x09';
    -      const leefAttribs = Object.entries(this.attrabutes);
    +      const leefAttribs = Object.entries(this.attributes);
           const leefAttribsLen = leefAttribs.length;
           for (let attrib = 0; attrib < leefAttribsLen; attrib++) {
             if (leefAttribs[attrib][1] !== null) {
    @@ -1896,36 +1895,36 @@ class LEEF {
      * A class to work with HP CEF (Common Event Format) messages. This form
      * of system messages are designed to work with security systems.  Messages can
      * be saved to file (Saving to file if not part of this module but a CEF 
    - * formated mesage produced by this module can be saved externaly to it) or 
    + * formatted message produced by this module can be saved externally to it) or 
      * sent via Syslog.
      * Most APIs will return a promise. These APIs can be used using 
      * `then(...)/catch(...)`
      * 
      * A Syslog class with a configured Syslog server target can also be used as 
    - * the input into the formating classes so that it may run independtly. The CEF 
    + * the input into the formatting classes so that it may run independently. The CEF 
      * format is designed to send event data to a SIEM system and should not be as 
    - * a logging stream. This class is ment to be used once per message.
    + * a logging stream. This class is meant to be used once per message.
      * @requires moment
      * @version 0.0.0
      * @since 0.0.0
      */
     class CEF {
       /**
    -   * Construct a new CEF formating object with user options 
    +   * Construct a new CEF formatting object with user options 
        * @public
        * @param {object} [options] - Options object
        * @param {string} [options.deviceVendor='unknown'] - The vendor of the system 
    -   *    that genrated the event being reported
    +   *    that generated the event being reported
        * @param {string} [options.deviceProduct='unknown'] - The product name of the 
        *    system that genrated the event being reported
        * @param {string} [options.deviceVersion='unknown'] - The version name of the 
        *    system that genrated the event being reported
        * @param {string} [options.deviceEventClassId='unknown'] - The eventId of the 
        *    system that genrated the event being reported
    -   * @param {string} [options.name='unknown'] - Name of the service genrating 
    +   * @param {string} [options.name='unknown'] - Name of the service generating 
        *    the notice
        * @param {string} [options.severity='unknown'] - Severity of the notification
    -   * @param {string} [options.extensions={}] - Any CEF Key=Value extentions
    +   * @param {string} [options.extensions={}] - Any CEF Key=Value extensions
        * @param {Syslog} [options.server=false] - A {@link module:SyslogPro~Syslog|
        *    Syslog server connection} that should be used to send messages directly 
        *    from this class. @see SyslogPro~Syslog
    @@ -2118,8 +2117,8 @@ class CEF {
       /**
        * Validate this CEF object
        * @public
    -   * @return {Promise} - True if valadated
    -   * @throws {Error} - First element to fail valadation
    +   * @return {Promise} - True if validated
    +   * @throws {Error} - First element to fail validation
        */  
       validate () {
         return new Promise ((resolve, reject) => {
    @@ -2402,7 +2401,9 @@ module.exports = {
       LEEF: LEEF,
       CEF: CEF,
       Syslog: Syslog
    -};
    +}; + +
    @@ -2416,7 +2417,7 @@ module.exports = {
    - Documentation generated by JSDoc 3.5.5 on Tue Sep 25 2018 18:22:00 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Sep 25 2018 19:11:53 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/docs/module-SyslogPro-CEF.html b/docs/module-SyslogPro-CEF.html index b0465d5..c1f6152 100644 --- a/docs/module-SyslogPro-CEF.html +++ b/docs/module-SyslogPro-CEF.html @@ -52,15 +52,15 @@
    A class to work with HP CEF (Common Event Format) messages. This form of system messages are designed to work with security systems. Messages can be saved to file (Saving to file if not part of this module but a CEF -formated mesage produced by this module can be saved externaly to it) or +formatted message produced by this module can be saved externally to it) or sent via Syslog. Most APIs will return a promise. These APIs can be used using `then(...)/catch(...)` A Syslog class with a configured Syslog server target can also be used as -the input into the formating classes so that it may run independtly. The CEF +the input into the formatting classes so that it may run independently. The CEF format is designed to send event data to a SIEM system and should not be as -a logging stream. This class is ment to be used once per message.
    +a logging stream. This class is meant to be used once per message.
    @@ -87,7 +87,7 @@ a logging stream. This class is ment to be used once per message.
    Source:
    @@ -133,7 +133,7 @@ a logging stream. This class is ment to be used once per message.
    - Construct a new CEF formating object with user options + Construct a new CEF formatting object with user options
    @@ -262,7 +262,7 @@ a logging stream. This class is ment to be used once per message. The vendor of the system - that genrated the event being reported + that generated the event being reported @@ -421,7 +421,7 @@ a logging stream. This class is ment to be used once per message. - Name of the service genrating + Name of the service generating the notice @@ -500,7 +500,7 @@ a logging stream. This class is ment to be used once per message. - Any CEF Key=Value extentions + Any CEF Key=Value extensions @@ -610,7 +610,7 @@ a logging stream. This class is ment to be used once per message.
    Source:
    @@ -669,7 +669,7 @@ a logging stream. This class is ment to be used once per message.
    Source:
    @@ -738,7 +738,7 @@ a logging stream. This class is ment to be used once per message.
    Source:
    @@ -807,7 +807,7 @@ a logging stream. This class is ment to be used once per message.
    Source:
    @@ -876,7 +876,7 @@ a logging stream. This class is ment to be used once per message.
    Source:
    @@ -945,7 +945,7 @@ a logging stream. This class is ment to be used once per message.
    Source:
    @@ -1014,7 +1014,7 @@ a logging stream. This class is ment to be used once per message.
    Source:
    @@ -1083,7 +1083,7 @@ a logging stream. This class is ment to be used once per message.
    Source:
    @@ -1142,7 +1142,7 @@ a logging stream. This class is ment to be used once per message.
    Source:
    @@ -1221,7 +1221,7 @@ a logging stream. This class is ment to be used once per message.
    Source:
    @@ -1327,7 +1327,7 @@ a logging stream. This class is ment to be used once per message.
    Source:
    @@ -1477,7 +1477,7 @@ a logging stream. This class is ment to be used once per message.
    Source:
    @@ -1547,7 +1547,7 @@ a logging stream. This class is ment to be used once per message.
    - - First element to fail valadation + - First element to fail validation
    @@ -1575,7 +1575,7 @@ a logging stream. This class is ment to be used once per message.
    - - True if valadated + - True if validated
    @@ -1615,7 +1615,7 @@ a logging stream. This class is ment to be used once per message.
    - Documentation generated by JSDoc 3.5.5 on Tue Sep 25 2018 18:22:00 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Sep 25 2018 19:11:53 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/docs/module-SyslogPro-LEEF.html b/docs/module-SyslogPro-LEEF.html index 6fae4e5..c55268d 100644 --- a/docs/module-SyslogPro-LEEF.html +++ b/docs/module-SyslogPro-LEEF.html @@ -52,15 +52,15 @@
    A class to work with IBM LEEF (Log Event Extended Format) messages this form of system messages are designed to work with security systems. Messages can be saved to file (Saving to file if not part of this module but a LEEF -formated mesage produced by this module can be saved externaly to it) or +formatted message produced by this module can be saved externally to it) or sent via Syslog. Most APIs will return a promise. These APIs can be used using `then(...)/catch(...)` A Syslog class with a configured Syslog server target can also be used as -the input into the formating classes so that it may run independtly. The +the input into the formatting classes so that it may run independently. The LEEF format is designed to send event data to a SIEM system and should not -be as a logging stream. This class is ment to be used once per message.
    +be as a logging stream. This class is meant to be used once per message. @@ -87,7 +87,7 @@ be as a logging stream. This class is ment to be used once per message.
    Source:
    @@ -133,7 +133,7 @@ be as a logging stream. This class is ment to be used once per message.
    - Construct a new LEEF formating object with user options + Construct a new LEEF formatting object with user options
    @@ -262,7 +262,7 @@ be as a logging stream. This class is ment to be used once per message. The vendor of the system that - genrated the event being reported + generated the event being reported @@ -389,7 +389,7 @@ be as a logging stream. This class is ment to be used once per message. - attrabute + attributes @@ -419,8 +419,8 @@ be as a logging stream. This class is ment to be used once per message. - LEEF message attrabutes which - defualts to all base attrabutes with null values, new attrabutes should + LEEF message attributes which + defaults to all base attributes with null values, new attributes should be added as new elements to this object @@ -560,7 +560,7 @@ be as a logging stream. This class is ment to be used once per message. -

    attrabutes :object

    +

    attributes :object

    @@ -571,7 +571,7 @@ be as a logging stream. This class is ment to be used once per message.
    Source:
    @@ -640,7 +640,7 @@ be as a logging stream. This class is ment to be used once per message.
    Source:
    @@ -699,7 +699,7 @@ be as a logging stream. This class is ment to be used once per message.
    Source:
    @@ -768,7 +768,7 @@ be as a logging stream. This class is ment to be used once per message.
    Source:
    @@ -837,7 +837,7 @@ be as a logging stream. This class is ment to be used once per message.
    Source:
    @@ -896,7 +896,7 @@ be as a logging stream. This class is ment to be used once per message.
    Source:
    @@ -965,7 +965,7 @@ be as a logging stream. This class is ment to be used once per message.
    Source:
    @@ -1034,7 +1034,7 @@ be as a logging stream. This class is ment to be used once per message.
    Source:
    @@ -1113,7 +1113,7 @@ be as a logging stream. This class is ment to be used once per message.
    Source:
    @@ -1153,7 +1153,7 @@ be as a logging stream. This class is ment to be used once per message.
    - Build a formated message + Build a formatted message
    @@ -1182,7 +1182,7 @@ be as a logging stream. This class is ment to be used once per message.
    - - string with formated message + - string with formatted message
    @@ -1219,7 +1219,7 @@ be as a logging stream. This class is ment to be used once per message.
    Source:
    @@ -1372,7 +1372,7 @@ be as a logging stream. This class is ment to be used once per message.
    - Documentation generated by JSDoc 3.5.5 on Tue Sep 25 2018 18:22:00 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Sep 25 2018 19:11:53 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/docs/module-SyslogPro-RFC3164.html b/docs/module-SyslogPro-RFC3164.html index 2c7a9d0..bbc32e1 100644 --- a/docs/module-SyslogPro-RFC3164.html +++ b/docs/module-SyslogPro-RFC3164.html @@ -49,18 +49,18 @@ RFC3164 -
    A class to work with RFC3164 formated syslog messages. The meesaging is fully configurabule and Ansi foreground -colors can be added. Both ANSI 8 and ANSI 256 color are fully suported. +
    A class to work with RFC3164 formatted syslog messages. The messaging is fully configurable and ANSI foreground +colors can be added. Both ANSI 8 and ANSI 256 color are fully supported. Most APIs will return a promise. These APIs can be used using `then(...)/catch(...)` A Syslog class with a configured -Syslog server target can also be used as the input into the formating -classes so that it may run independtly. +Syslog server target can also be used as the input into the formatting +classes so that it may run independently. -The RFC3164 Syslog logging format is ment to be used as a stream of log data -from a service or applacation. This class is designed to be used in this -fashion where new messages are writen to the class as needed.
    +The RFC3164 Syslog logging format is meant to be used as a stream of log data +from a service or application. This class is designed to be used in this +fashion where new messages are written to the class as needed.
    @@ -133,7 +133,7 @@ fashion where new messages are writen to the class as needed.
    - Construct a new RFC3164 formated Syslog object with user options + Construct a new RFC3164 formatted Syslog object with user options
    @@ -261,7 +261,7 @@ fashion where new messages are writen to the class as needed. - Applacation + Application @@ -419,7 +419,7 @@ fashion where new messages are writen to the class as needed. - Use the extedned ANSI + Use the extended ANSI color set encoding tag with syslog message text @@ -458,7 +458,7 @@ fashion where new messages are writen to the class as needed. User defended colors for - severites + severities
    Properties
    @@ -1614,7 +1614,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -1654,7 +1654,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 1 (Alert) + Send a syslog message with a severity level of 1 (Alert)
    @@ -1733,7 +1733,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -1761,7 +1761,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -1838,7 +1838,7 @@ fashion where new messages are writen to the class as needed.
    - Building a formated message. Returns a promise with a formated message + Building a formatted message. Returns a promise with a formatted message
    @@ -2097,7 +2097,7 @@ fashion where new messages are writen to the class as needed.
    - A Syslog formated string acording to the selected RFC + A Syslog formatted string according to the selected RFC
    @@ -2134,7 +2134,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -2174,7 +2174,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 2 (Critical) + Send a syslog message with a severity level of 2 (Critical)
    @@ -2253,7 +2253,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -2281,7 +2281,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -2318,7 +2318,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -2358,7 +2358,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 2 (Critical) + Send a syslog message with a severity level of 2 (Critical)
    @@ -2437,7 +2437,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -2465,7 +2465,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -2502,7 +2502,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -2542,7 +2542,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 7 (Debug) + Send a syslog message with a severity level of 7 (Debug)
    @@ -2621,7 +2621,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -2649,7 +2649,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -2686,7 +2686,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -2726,7 +2726,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 0 (Emergency) + Send a syslog message with a security level of 0 (Emergency)
    @@ -2780,7 +2780,7 @@ fashion where new messages are writen to the class as needed. - The emergancy message to send to the Syslog server + The emergency message to send to the Syslog server @@ -2805,7 +2805,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -2833,7 +2833,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -2870,7 +2870,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -2910,7 +2910,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 0 (Emergency) + Send a syslog message with a security level of 0 (Emergency)
    @@ -2964,7 +2964,7 @@ fashion where new messages are writen to the class as needed. - The emergancy message to send to the Syslog server + The emergency message to send to the Syslog server @@ -2989,7 +2989,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -3017,7 +3017,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -3054,7 +3054,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -3094,7 +3094,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 3 (Error) + Send a syslog message with a severity level of 3 (Error)
    @@ -3173,7 +3173,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -3201,7 +3201,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -3238,7 +3238,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -3278,7 +3278,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 3 (Error) + Send a syslog message with a severity level of 3 (Error)
    @@ -3357,7 +3357,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -3385,7 +3385,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -3422,7 +3422,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -3462,7 +3462,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 6 (Informational) + Send a syslog message with a severity level of 6 (Informational)
    @@ -3541,7 +3541,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -3569,7 +3569,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -3606,7 +3606,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -3646,7 +3646,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 6 (Informational) + Send a syslog message with a severity level of 6 (Informational)
    @@ -3725,7 +3725,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -3753,7 +3753,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -3790,7 +3790,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -3830,7 +3830,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 6 (Informational) + Send a syslog message with a severity level of 6 (Informational)
    @@ -3909,7 +3909,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -3937,7 +3937,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -3974,7 +3974,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -4014,7 +4014,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 5 (Notice) + Send a syslog message with a severity level of 5 (Notice)
    @@ -4093,7 +4093,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -4121,7 +4121,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -4158,7 +4158,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -4198,7 +4198,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 5 (Notice) + Send a syslog message with a severity level of 5 (Notice)
    @@ -4277,7 +4277,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -4305,7 +4305,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -4342,7 +4342,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -4389,9 +4389,9 @@ fashion where new messages are writen to the class as needed.
    - send a RFC5424 formated message. Returns a promise with the formated + send a RFC5424 formatted message. Returns a promise with the formatted message that was sent. If no server connection was defined when the - class was created a defualt Syslog connector will be used. + class was created a default Syslog connector will be used.
    @@ -4455,7 +4455,7 @@ fashion where new messages are writen to the class as needed. - The unformated Syslog message to send + The unformatted Syslog message to send @@ -4649,7 +4649,7 @@ fashion where new messages are writen to the class as needed.
    - A Syslog formated string acording to the selected RFC + A Syslog formatted string according to the selected RFC
    @@ -5107,7 +5107,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -5147,7 +5147,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 4 (Warning) + Send a syslog message with a severity level of 4 (Warning)
    @@ -5226,7 +5226,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -5254,7 +5254,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -5291,7 +5291,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -5331,7 +5331,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 4 (Warning) + Send a syslog message with a severity level of 4 (Warning)
    @@ -5410,7 +5410,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -5438,7 +5438,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -5478,7 +5478,7 @@ fashion where new messages are writen to the class as needed.
    - Documentation generated by JSDoc 3.5.5 on Tue Sep 25 2018 18:22:00 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Sep 25 2018 19:11:53 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/docs/module-SyslogPro-RFC5424.html b/docs/module-SyslogPro-RFC5424.html index d348606..ddff4c5 100644 --- a/docs/module-SyslogPro-RFC5424.html +++ b/docs/module-SyslogPro-RFC5424.html @@ -49,18 +49,18 @@ RFC5424 -
    A class to work with RFC5424 formated syslog messages. The meesaging is fully configurabule and Ansi foreground -colors can be added. Both ANSI 8 and ANSI 256 color are fully suported. +
    A class to work with RFC5424 formatted syslog messages. The messaging is fully configurable and ANSI foreground +colors can be added. Both ANSI 8 and ANSI 256 color are fully supported. Most APIs will return a promise. These APIs can be used using `then(...)/catch(...)` A Syslog class with a configured -Syslog server target can also be used as the input into the formating -classes so that it may run independtly. +Syslog server target can also be used as the input into the formatting +classes so that it may run independently. -The RFC5424 Syslog logging format is ment to be used as a stream of log data -from a service or applacation. This class is designed to be used in this -fashion where new messages are writen to the class as needed.
    +The RFC5424 Syslog logging format is meant to be used as a stream of log data +from a service or application. This class is designed to be used in this +fashion where new messages are written to the class as needed.
    @@ -87,7 +87,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -133,7 +133,7 @@ fashion where new messages are writen to the class as needed.
    - Construct a new RFC5424 formated Syslog object with user options + Construct a new RFC5424 formatted Syslog object with user options
    @@ -261,7 +261,7 @@ fashion where new messages are writen to the class as needed. - Applacation + Application @@ -378,7 +378,7 @@ fashion where new messages are writen to the class as needed. - RFC tandard is for + RFC standard is for local time @@ -419,7 +419,7 @@ fashion where new messages are writen to the class as needed. Timestamp with ms - resoltuion + resolution @@ -459,7 +459,7 @@ fashion where new messages are writen to the class as needed. Should the timestamp - included timezone + included time zone @@ -655,7 +655,7 @@ fashion where new messages are writen to the class as needed. User defended colors for - severites + severities
    Properties
    @@ -1073,7 +1073,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -1132,7 +1132,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -1201,7 +1201,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -1260,7 +1260,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -1319,7 +1319,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -1378,7 +1378,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -1437,7 +1437,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -1506,7 +1506,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -1565,7 +1565,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -1634,7 +1634,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -1693,7 +1693,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -1752,7 +1752,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -1811,7 +1811,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -1880,7 +1880,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -1949,7 +1949,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -2018,7 +2018,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -2087,7 +2087,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -2156,7 +2156,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -2225,7 +2225,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -2265,7 +2265,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 1 (Alert) + Send a syslog message with a severity level of 1 (Alert)
    @@ -2344,7 +2344,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -2372,7 +2372,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -2409,7 +2409,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -2449,7 +2449,7 @@ fashion where new messages are writen to the class as needed.
    - Building a formated message. Returns a promise with a formated message + Building a formatted message. Returns a promise with a formatted message
    @@ -2727,7 +2727,7 @@ fashion where new messages are writen to the class as needed. An array of structure data strings conforming to the IETF/IANA defined SD-IDs or IANA - registred SMI Network Management Private Enterprise Code SD-ID + registered SMI Network Management Private Enterprise Code SD-ID conforming to the format [name@ parameter=value] @@ -2829,7 +2829,7 @@ fashion where new messages are writen to the class as needed.
    - A Syslog formated string acording to the selected RFC + A Syslog formatted string according to the selected RFC
    @@ -2866,7 +2866,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -2906,7 +2906,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 2 (Critical) + Send a syslog message with a severity level of 2 (Critical)
    @@ -2985,7 +2985,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -3013,7 +3013,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -3050,7 +3050,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -3090,7 +3090,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 2 (Critical) + Send a syslog message with a severity level of 2 (Critical)
    @@ -3169,7 +3169,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -3197,7 +3197,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -3234,7 +3234,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -3274,7 +3274,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 7 (Debug) + Send a syslog message with a severity level of 7 (Debug)
    @@ -3353,7 +3353,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -3381,7 +3381,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -3418,7 +3418,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -3458,7 +3458,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 0 (Emergency) + Send a syslog message with a severity level of 0 (Emergency)
    @@ -3512,7 +3512,7 @@ fashion where new messages are writen to the class as needed. - The emergancy message to send to the Syslog server + The emergency message to send to the Syslog server @@ -3537,7 +3537,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -3565,7 +3565,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -3602,7 +3602,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -3642,7 +3642,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 0 (Emergency) + Send a syslog message with a severity level of 0 (Emergency)
    @@ -3696,7 +3696,7 @@ fashion where new messages are writen to the class as needed. - The emergancy message to send to the Syslog server + The emergency message to send to the Syslog server @@ -3721,7 +3721,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -3749,7 +3749,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -3786,7 +3786,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -3826,7 +3826,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 3 (Error) + Send a syslog message with a severity level of 3 (Error)
    @@ -3905,7 +3905,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -3933,7 +3933,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -3970,7 +3970,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -4010,7 +4010,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 3 (Error) + Send a syslog message with a severity level of 3 (Error)
    @@ -4089,7 +4089,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -4117,7 +4117,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -4154,7 +4154,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -4194,7 +4194,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 6 (Informational) + Send a syslog message with a severity level of 6 (Informational)
    @@ -4273,7 +4273,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -4301,7 +4301,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -4338,7 +4338,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -4378,7 +4378,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 6 (Informational) + Send a syslog message with a severity level of 6 (Informational)
    @@ -4457,7 +4457,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -4485,7 +4485,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -4522,7 +4522,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -4562,7 +4562,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 6 (Informational) + Send a syslog message with a severity level of 6 (Informational)
    @@ -4641,7 +4641,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -4669,7 +4669,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -4706,7 +4706,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -4746,7 +4746,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 5 (Notice) + Send a syslog message with a severity level of 5 (Notice)
    @@ -4825,7 +4825,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -4853,7 +4853,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -4890,7 +4890,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -4930,7 +4930,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 5 (Notice) + Send a syslog message with a severity level of 5 (Notice)
    @@ -5009,7 +5009,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -5037,7 +5037,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -5074,7 +5074,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -5121,9 +5121,9 @@ fashion where new messages are writen to the class as needed.
    - send a RFC5424 formated message. Returns a promise with the formated + send a RFC5424 formatted message. Returns a promise with the formatted message that was sent. If no server connection was defined when the - class was created a defualt Syslog connector will be used. + class was created a default Syslog connector will be used.
    @@ -5177,7 +5177,7 @@ fashion where new messages are writen to the class as needed. - The unformated Syslog message to send + The unformatted Syslog message to send @@ -5230,7 +5230,7 @@ fashion where new messages are writen to the class as needed.
    - A Syslog formated string acording to the selected RFC + A Syslog formatted string according to the selected RFC
    @@ -5267,7 +5267,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -5688,7 +5688,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -5728,7 +5728,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 4 (Warning) + Send a syslog message with a severity level of 4 (Warning)
    @@ -5807,7 +5807,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -5835,7 +5835,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -5872,7 +5872,7 @@ fashion where new messages are writen to the class as needed.
    Source:
    @@ -5912,7 +5912,7 @@ fashion where new messages are writen to the class as needed.
    - Send a syslog message with a secerity level of 4 (Warning) + Send a syslog message with a severity level of 4 (Warning)
    @@ -5991,7 +5991,7 @@ fashion where new messages are writen to the class as needed.
    - - Any bubbled up error + - Any bubbled-up error
    @@ -6019,7 +6019,7 @@ fashion where new messages are writen to the class as needed.
    - - The formated syslog message sent to the Syslog server + - The formatted syslog message sent to the Syslog server
    @@ -6059,7 +6059,7 @@ fashion where new messages are writen to the class as needed.
    - Documentation generated by JSDoc 3.5.5 on Tue Sep 25 2018 18:22:00 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Sep 25 2018 19:11:53 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/docs/module-SyslogPro-Syslog.html b/docs/module-SyslogPro-Syslog.html index 612b5d6..623d970 100644 --- a/docs/module-SyslogPro-Syslog.html +++ b/docs/module-SyslogPro-Syslog.html @@ -50,11 +50,11 @@
    A class to work with syslog messages using UDP, TCP, or TLS transport. -There is suport for Syslog message formating RFC-3164, RFC-5424 including +There is support for Syslog message formatting RFC-3164, RFC-5424 including Structured Data, IBM LEEF (Log Event Extended Format), and HP CEF (Common Event Format). -Syslog formating classes can be used as input into a Syslog class to be used -simultatniusly to the same Syslog server. *
    +Syslog formatting classes can be used as input into a Syslog class to be used +simultaneously to the same Syslog server. * @@ -81,7 +81,7 @@ simultatniusly to the same Syslog server. *
    Source:
    @@ -194,7 +194,7 @@ simultatniusly to the same Syslog server. * Options object ->>>Transport Configuraton +>>>Transport Configuration
    Properties
    @@ -257,8 +257,8 @@ simultatniusly to the same Syslog server. * The IP Address|FQDN of the - Syslog Server, this option if set will take prasdents over any target - set in a formating object + Syslog Server, this option if set will take presidents over any target + set in a formatting object @@ -297,9 +297,9 @@ simultatniusly to the same Syslog server. * - L4 transport portocol - (udp|tcp|tls), this option if set will take prasdents over any transport - set in a formating object + L4 transport protocol + (udp|tcp|tls), this option if set will take presidents over any transport + set in a formatting object @@ -339,7 +339,7 @@ simultatniusly to the same Syslog server. * IP port, this option if set will take - prasdents over any IP Port set in a formating object + presidents over any IP Port set in a formatting object @@ -379,8 +379,8 @@ simultatniusly to the same Syslog server. * Ignored for all other - transports, this option if set will take prasdents over any timeout - set in a formating object + transports, this option if set will take presidents over any timeout + set in a formatting object @@ -417,9 +417,9 @@ simultatniusly to the same Syslog server. * - Array of authrized TLS server - certificates file locations, this option if set will take prasdents - over any certificates set in a formating object + Array of authorized TLS server + certificates file locations, this option if set will take presidents + over any certificates set in a formatting object @@ -458,7 +458,7 @@ simultatniusly to the same Syslog server. * Client TLS certificate file location that this client should use, this option if set will take - prasdents over any certificates set in a formating object + presidents over any certificates set in a formatting object @@ -497,7 +497,7 @@ simultatniusly to the same Syslog server. * Client TLS key file location that this client should use, this option if set will take - prasdents over any certificates set in a formating object + presidents over any certificates set in a formatting object >>>Syslog Format Settings @@ -686,7 +686,7 @@ simultatniusly to the same Syslog server. * - HP CEF (Common Event Format) formating object + HP CEF (Common Event Format) formatting object @@ -756,7 +756,7 @@ simultatniusly to the same Syslog server. *
    Source:
    @@ -825,7 +825,7 @@ simultatniusly to the same Syslog server. *
    Source:
    @@ -894,7 +894,7 @@ simultatniusly to the same Syslog server. *
    Source:
    @@ -963,7 +963,7 @@ simultatniusly to the same Syslog server. *
    Source:
    @@ -1032,7 +1032,7 @@ simultatniusly to the same Syslog server. *
    Source:
    @@ -1101,7 +1101,7 @@ simultatniusly to the same Syslog server. *
    Source:
    @@ -1170,7 +1170,7 @@ simultatniusly to the same Syslog server. *
    Source:
    @@ -1239,7 +1239,7 @@ simultatniusly to the same Syslog server. *
    Source:
    @@ -1308,7 +1308,7 @@ simultatniusly to the same Syslog server. *
    Source:
    @@ -1377,7 +1377,7 @@ simultatniusly to the same Syslog server. *
    Source:
    @@ -1446,7 +1446,7 @@ simultatniusly to the same Syslog server. *
    Source:
    @@ -1515,7 +1515,7 @@ simultatniusly to the same Syslog server. *
    Source:
    @@ -1584,7 +1584,7 @@ simultatniusly to the same Syslog server. *
    Source:
    @@ -1653,7 +1653,7 @@ simultatniusly to the same Syslog server. *
    Source:
    @@ -1699,9 +1699,9 @@ simultatniusly to the same Syslog server. *
    - Add a TLS server certificate which can be used to authentacat the server -this syslog client is connecting too. This function will valadate the -input as a file location straing and add it to an array of certificates + Add a TLS server certificate which can be used to authenticate the server +this syslog client is connecting too. This function will validate the +input as a file location string and add it to an array of certificates
    @@ -1943,7 +1943,7 @@ selected transport. - The formated Syslog Message + The formatted Syslog Message @@ -2023,7 +2023,7 @@ selected transport.
    - - The Syslog formated string sent + - The Syslog formatted string sent
    @@ -2060,7 +2060,7 @@ selected transport.
    Source:
    @@ -2154,7 +2154,7 @@ selected transport. - The formated Syslog Message + The formatted Syslog Message @@ -2234,7 +2234,7 @@ selected transport.
    - - The Syslog formated string sent + - The Syslog formatted string sent
    @@ -2271,7 +2271,7 @@ selected transport.
    Source:
    @@ -2365,7 +2365,7 @@ selected transport. - The formated Syslog Message + The formatted Syslog Message @@ -2445,7 +2445,7 @@ selected transport.
    - - The Syslog formated string sent + - The Syslog formatted string sent
    @@ -2482,7 +2482,7 @@ selected transport.
    Source:
    @@ -2576,7 +2576,7 @@ selected transport. - The formated Syslog Message + The formatted Syslog Message @@ -2629,7 +2629,7 @@ selected transport.
    - - The Syslog formated string sent + - The Syslog formatted string sent
    @@ -2669,7 +2669,7 @@ selected transport.
    - Documentation generated by JSDoc 3.5.5 on Tue Sep 25 2018 18:22:00 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Sep 25 2018 19:11:53 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/docs/module-SyslogPro.html b/docs/module-SyslogPro.html index 64004a3..33a354a 100644 --- a/docs/module-SyslogPro.html +++ b/docs/module-SyslogPro.html @@ -58,10 +58,10 @@ Most APIs will return a promise. These APIs can be used using `then(...)/catch(...)` -Syslog formating classes can be used as input into a Syslog class to be used -simultatniusly to the same Syslog server. The Syslog Class with a configured -Syslog server target can also be used as the input into each of the formating -classes so that they may run independtly. +Syslog formatting classes can be used as input into a Syslog class to be used +simultaneously to the same Syslog server. The Syslog Class with a configured +Syslog server target can also be used as the input into each of the formatting +classes so that they may run independently. @@ -75,7 +75,7 @@ classes so that they may run independtly.
    Source:
    @@ -207,7 +207,7 @@ classes so that they may run independtly.
    Source:
    @@ -355,7 +355,7 @@ classes so that they may run independtly.
    - - The formated ANSI color code + - The formatted ANSI color code
    @@ -395,7 +395,7 @@ classes so that they may run independtly.
    - Documentation generated by JSDoc 3.5.5 on Tue Sep 25 2018 18:22:00 GMT+0000 (Coordinated Universal Time) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Sep 25 2018 19:11:53 GMT+0000 (Coordinated Universal Time) using the docdash theme.
    diff --git a/index.js b/index.js index 874be00..8581ba5 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,4 @@ +// INDEX.JS /** Copyright (c) 2018 Craig Yamato */ /** @@ -5,10 +6,10 @@ * Most APIs will return a promise. These APIs can be used using * `then(...)/catch(...)` * - * Syslog formating classes can be used as input into a Syslog class to be used - * simultatniusly to the same Syslog server. The Syslog Class with a configured - * Syslog server target can also be used as the input into each of the formating - * classes so that they may run independtly. + * Syslog formatting classes can be used as input into a Syslog class to be used + * simultaneously to the same Syslog server. The Syslog Class with a configured + * Syslog server target can also be used as the input into each of the formatting + * classes so that they may run independently. * @author Craig Yamato * @copyright (c) 2018 - Craig Yamato * @version 0.1.0 @@ -29,7 +30,7 @@ const fs = require("fs"); * @private * @param {string} hex - The color hex code in the form of #FFFFFF or Number of * the ANSI color code (30-37 Standard & 0-255 Extended) - * @returns {Promise} - The formated ANSI color code + * @returns {Promise} - The formatted ANSI color code * @throws {Error} - A Format Error */ function rgbToAnsi (hex, extendedColor) { @@ -94,11 +95,11 @@ function rgbToAnsi (hex, extendedColor) { /** * A class to work with syslog messages using UDP, TCP, or TLS transport. - * There is suport for Syslog message formating RFC-3164, RFC-5424 including + * There is support for Syslog message formatting RFC-3164, RFC-5424 including * Structured Data, IBM LEEF (Log Event Extended Format), and HP CEF (Common * Event Format). - * Syslog formating classes can be used as input into a Syslog class to be used - * simultatniusly to the same Syslog server. * + * Syslog formatting classes can be used as input into a Syslog class to be used + * simultaneously to the same Syslog server. * * @requires moment * @version 0.0.0 * @since 0.0.0 @@ -111,27 +112,27 @@ class Syslog { * @since 0.0.0 * @this Syslog * @param {object} [options] - Options object - * >>>Transport Configuraton + * >>>Transport Configuration * @param {string} [options.target='localhost'] - The IP Address|FQDN of the - * Syslog Server, this option if set will take prasdents over any target - * set in a formating object - * @param {string} [options.protocol='udp'] - L4 transport portocol - * (udp|tcp|tls), this option if set will take prasdents over any transport - * set in a formating object + * Syslog Server, this option if set will take presidents over any target + * set in a formatting object + * @param {string} [options.protocol='udp'] - L4 transport protocol + * (udp|tcp|tls), this option if set will take presidents over any transport + * set in a formatting object * @param {number} [options.port=514] - IP port, this option if set will take - * prasdents over any IP Port set in a formating object + * presidents over any IP Port set in a formatting object * @param {number} [options.tcpTimeout=10000] - Ignored for all other - * transports, this option if set will take prasdents over any timeout - * set in a formating object - * @param {string[]} [options.tlsServerCerts] - Array of authrized TLS server - * certificates file locations, this option if set will take prasdents - * over any certificates set in a formating object + * transports, this option if set will take presidents over any timeout + * set in a formatting object + * @param {string[]} [options.tlsServerCerts] - Array of authorized TLS server + * certificates file locations, this option if set will take presidents + * over any certificates set in a formatting object * @param {string} [options.tlsClientCert] - Client TLS certificate file * location that this client should use, this option if set will take - * prasdents over any certificates set in a formating object + * presidents over any certificates set in a formatting object * @param {string} [options.tlsClientKey] - Client TLS key file * location that this client should use, this option if set will take - * prasdents over any certificates set in a formating object + * presidents over any certificates set in a formatting object * >>>Syslog Format Settings * @param {string} [options.format='none'] - Valid syslog format options for * this module are 'none', 'rfc3164', 'rfc5424', 'leef', 'cef' @@ -142,7 +143,7 @@ class Syslog { * @param {LEEF} [options.leef] - {@link module:SyslogPro~LEEF|IBM LEEF * (Log Event Extended Format) object} * @param {CEF} [options.cef] - {@link module:SyslogPro~CEF|HP CEF - * (Common Event Format) formating object} + * (Common Event Format) formatting object} */ constructor (options) { this.constructor__ = true; @@ -229,9 +230,9 @@ class Syslog { } /** - * Add a TLS server certificate which can be used to authentacat the server - * this syslog client is connecting too. This function will valadate the - * input as a file location straing and add it to an array of certificates + * Add a TLS server certificate which can be used to authenticate the server + * this syslog client is connecting too. This function will validate the + * input as a file location string and add it to an array of certificates * @private * @version 0.0.0 * @since 0.0.0 @@ -247,7 +248,7 @@ class Syslog { } else if (typeof certs === 'string') { this.tlsServerCerts = [certs]; } else { - let errMsg = 'TYPE ERROR: Server Cert file loctions shoudl be a string'; + let errMsg = 'TYPE ERROR: Server Cert file locations should be a string'; errMsg += ' or array of strings'; reject(new Error(errMsg)); } @@ -257,8 +258,8 @@ class Syslog { /** * Send the Syslog message over UDP * @private - * @param {string} msg - The formated Syslog Message - * @returns {Promise} - The Syslog formated string sent + * @param {string} msg - The formatted Syslog Message + * @returns {Promise} - The Syslog formatted string sent * @throws {Error} - Network Error */ udpMessage (msg) { @@ -286,8 +287,8 @@ class Syslog { /** * Send the Syslog message over TCP * @private - * @param {string} msg - The formated Syslog Message - * @returns {Promise} - The Syslog formated string sent + * @param {string} msg - The formatted Syslog Message + * @returns {Promise} - The Syslog formatted string sent * @throws {Error} - Timeout error for TCP and TLS connections * @throws {Error} - Network Error */ @@ -332,8 +333,8 @@ class Syslog { /** * Send the Syslog message over TLS * @private - * @param {string} msg - The formated Syslog Message - * @returns {Promise} - The Syslog formated string sent + * @param {string} msg - The formatted Syslog Message + * @returns {Promise} - The Syslog formatted string sent * @throws {Error} - Timeout error for TCP and TLS connections * @throws {Error} - Network Error */ @@ -378,7 +379,7 @@ class Syslog { tlsOptions.ca = tlsOptionsCerts; tlsOptions.rejectUnauthorized = true; } - const client = tls.connect(tlsOptions, () => { + const client = tls.connect(tlsOptions, () => { // Turn msg in to a UTF8 buffer let msgBuffer = Buffer.from(msg, 'utf8'); client.write(msgBuffer, () => { @@ -386,7 +387,6 @@ class Syslog { }); }); client.setTimeout(this.tcpTimeout); - // client.on('data', (data) => {}); client.on('end', () => { resolve(msg); }); @@ -404,8 +404,8 @@ class Syslog { * Send the Syslog message to the selected target Syslog server using the * selected transport. * @private - * @param {string} msg - The formated Syslog Message - * @returns {Promise} - The Syslog formated string sent + * @param {string} msg - The formatted Syslog Message + * @returns {Promise} - The Syslog formatted string sent * @throws {Error} - Timeout error for TCP and TLS connections * @throws {Error} - Network Error */ @@ -441,7 +441,7 @@ class Syslog { reject(reson); }); } else { - let errorMsg = 'FORMAT ERROR: Protocol not reconized, should be '; + let errorMsg = 'FORMAT ERROR: Protocol not recognized, should be '; errorMsg += 'udp|tcp|tls'; reject(new Error(errorMsg)); } @@ -450,38 +450,38 @@ class Syslog { } /** - * A class to work with RFC3164 formated syslog messages. The meesaging is fully configurabule and Ansi foreground - * colors can be added. Both ANSI 8 and ANSI 256 color are fully suported. + * A class to work with RFC3164 formatted syslog messages. The messaging is fully configurable and ANSI foreground + * colors can be added. Both ANSI 8 and ANSI 256 color are fully supported. * Most APIs will return a promise. These APIs can be used using * `then(...)/catch(...)` * * A Syslog class with a configured - * Syslog server target can also be used as the input into the formating - * classes so that it may run independtly. + * Syslog server target can also be used as the input into the formatting + * classes so that it may run independently. * - * The RFC3164 Syslog logging format is ment to be used as a stream of log data - * from a service or applacation. This class is designed to be used in this - * fashion where new messages are writen to the class as needed. + * The RFC3164 Syslog logging format is meant to be used as a stream of log data + * from a service or application. This class is designed to be used in this + * fashion where new messages are written to the class as needed. * @requires moment * @version 0.0.0 * @since 0.0.0 */ class RFC3164 { /** - * Construct a new RFC3164 formated Syslog object with user options + * Construct a new RFC3164 formatted Syslog object with user options * @public * @this RFC3164 * @param {object} [options] - Options object - * @param {string} [options.applacationName='NodeJSLogger'] - Applacation + * @param {string} [options.applacationName='NodeJSLogger'] - Application * @param {string} [options.hostname=os.hostname] - The name of this server * @param {number} [options.facility=23] - Facility code to use sending this * message * @param {boolean} [options.color=false] - Apply color coding encoding tag * with syslog message text - * @param {boolean} [options.extendedColor=false] - Use the extedned ANSI + * @param {boolean} [options.extendedColor=false] - Use the extended ANSI * color set encoding tag with syslog message text * @param {object} [options.colors] - User defended colors for - * severites + * severities * @param {string} [options.colors.emergencyColor] - A RGB Hex coded color in the form * of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 * Extended) @@ -738,14 +738,14 @@ class RFC3164 { }); } /** - * Building a formated message. Returns a promise with a formated message + * Building a formatted message. Returns a promise with a formatted message * @public * @param {string} msg - The Syslog Message * @param {object} [options] - Options object * @param {number} [options.severity=7] - An array of structure * @param {number} [options.colorCode=36] - The ANSI color code to use if * message coloration is selected - * @returns {Promise} A Syslog formated string acording to the selected RFC + * @returns {Promise} A Syslog formatted string according to the selected RFC * @throws {Error} A standard error object */ buildMessage (msg, options) { @@ -759,7 +759,7 @@ class RFC3164 { reject(new Error(errMsg)); return; } - let fmtMsg = ''; // Formated Syslog message string var + let fmtMsg = ''; // Formatted Syslog message string var const newLine = '\n'; const newLineRegEx = /(\r|\n|(\r\n))/; const escapeCode = '\u001B'; @@ -767,7 +767,7 @@ class RFC3164 { // The PRI is common to both RFC formats const pri = (this.facility * 8) + severity; // Remove any newline character - msg = msg.replace(newLineRegEx, ''); + msg = msg.replace(newLineRegEx, ''); // Add requested color if (this.color) { options.msgColor = options.msgColor || 36; @@ -779,17 +779,16 @@ class RFC3164 { colorCode += options.msgColor; colorCode += 'm'; // ANSI Color Closer } else { - colorCode = '[39m'; // Use terminal's defualt color + colorCode = '[39m'; // Use terminal's default color } msg = escapeCode + colorCode + msg + resetColor; } - // RegEx to find a leading 0 in the day of a DateTime for RFC3164 - // RFC3164 uses BSD timeformat + // RegEx to find a leading 0 in the day of a DateTime for RFC3164 RFC3164 uses BSD timeformat const rfc3164DateRegEx = /((A|D|F|J|M|N|O|S)(a|c|e|p|o|u)(b|c|g|l|n|p|r|t|v|y)\s)0(\d\s\d\d:\d\d:\d\d)/; const timestamp = moment() .format('MMM DD hh:mm:ss') .replace(rfc3164DateRegEx, '$1 $5'); - // Build message + // Build message fmtMsg = '<' + pri + '>'; fmtMsg += timestamp; fmtMsg += ' ' + this.hostname; @@ -800,16 +799,16 @@ class RFC3164 { }); } /** - * send a RFC5424 formated message. Returns a promise with the formated + * send a RFC5424 formatted message. Returns a promise with the formatted * message that was sent. If no server connection was defined when the - * class was created a defualt Syslog connector will be used. + * class was created a default Syslog connector will be used. * @see SyslogPro~Syslog * @public - * @param {string} msg - The unformated Syslog message to send + * @param {string} msg - The unformatted Syslog message to send * @param {object} [options] - Options object * @param {number} [options.severity=7] - An array of structure * @param {number} [options.colorCode=36] - The ANSI color code to use if - * @returns {Promise} A Syslog formated string acording to the selected RFC + * @returns {Promise} A Syslog formatted string according to the selected RFC * @throws {Error} A standard error object */ send (msg, options) { @@ -833,11 +832,11 @@ class RFC3164 { }); } /** - * Send a syslog message with a secerity level of 0 (Emergency) + * Send a syslog message with a security level of 0 (Emergency) * @public - * @param {string} msg - The emergancy message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @param {string} msg - The emergency message to send to the Syslog server + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ emergency (msg) { return this.send(msg, { @@ -846,21 +845,21 @@ class RFC3164 { }); } /** - * Send a syslog message with a secerity level of 0 (Emergency) + * Send a syslog message with a security level of 0 (Emergency) * @public - * @param {string} msg - The emergancy message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @param {string} msg - The emergency message to send to the Syslog server + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ emer (msg) { return this.emergency(msg); } /** - * Send a syslog message with a secerity level of 1 (Alert) + * Send a syslog message with a severity level of 1 (Alert) * @public * @param {string} msg - The alert message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ alert (msg) { return this.send(msg, { @@ -869,11 +868,11 @@ class RFC3164 { }); } /** - * Send a syslog message with a secerity level of 2 (Critical) + * Send a syslog message with a severity level of 2 (Critical) * @public * @param {string} msg - The critical message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ critical (msg) { return this.send(msg, { @@ -882,21 +881,21 @@ class RFC3164 { }); } /** - * Send a syslog message with a secerity level of 2 (Critical) + * Send a syslog message with a severity level of 2 (Critical) * @public * @param {string} msg - The critical message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ crit (msg) { return this.critical(msg); } /** - * Send a syslog message with a secerity level of 3 (Error) + * Send a syslog message with a severity level of 3 (Error) * @public * @param {string} msg - The error message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ error (msg) { return this.send(msg, { @@ -905,21 +904,21 @@ class RFC3164 { }); } /** - * Send a syslog message with a secerity level of 3 (Error) + * Send a syslog message with a severity level of 3 (Error) * @public * @param {string} msg - The error message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ err (msg) { return this.error(msg); } /** - * Send a syslog message with a secerity level of 4 (Warning) + * Send a syslog message with a severity level of 4 (Warning) * @public * @param {string} msg - The warning message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ warning (msg) { return this.send(msg, { @@ -928,21 +927,21 @@ class RFC3164 { }); } /** - * Send a syslog message with a secerity level of 4 (Warning) + * Send a syslog message with a severity level of 4 (Warning) * @public * @param {string} msg - The warning message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ warn (msg) { return this.warning(msg); } /** - * Send a syslog message with a secerity level of 5 (Notice) + * Send a syslog message with a severity level of 5 (Notice) * @public * @param {string} msg - The notice message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ notice (msg) { return this.send(msg, { @@ -951,21 +950,21 @@ class RFC3164 { }); } /** - * Send a syslog message with a secerity level of 5 (Notice) + * Send a syslog message with a severity level of 5 (Notice) * @public * @param {string} msg - The notice message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ note (msg) { return this.notice(msg); } /** - * Send a syslog message with a secerity level of 6 (Informational) + * Send a syslog message with a severity level of 6 (Informational) * @public * @param {string} msg - The informational message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ informational (msg) { return this.send(msg, { @@ -974,31 +973,31 @@ class RFC3164 { }); } /** - * Send a syslog message with a secerity level of 6 (Informational) + * Send a syslog message with a severity level of 6 (Informational) * @public * @param {string} msg - The informational message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ info (msg) { return this.informational(msg); } /** - * Send a syslog message with a secerity level of 6 (Informational) + * Send a syslog message with a severity level of 6 (Informational) * @public * @param {string} msg - The informational message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ log (msg) { return this.informational(msg); } /** - * Send a syslog message with a secerity level of 7 (Debug) + * Send a syslog message with a severity level of 7 (Debug) * @public * @param {string} msg - The debug message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ debug (msg) { return this.send(msg, { @@ -1009,37 +1008,37 @@ class RFC3164 { } /** - * A class to work with RFC5424 formated syslog messages. The meesaging is fully configurabule and Ansi foreground - * colors can be added. Both ANSI 8 and ANSI 256 color are fully suported. + * A class to work with RFC5424 formatted syslog messages. The messaging is fully configurable and ANSI foreground + * colors can be added. Both ANSI 8 and ANSI 256 color are fully supported. * Most APIs will return a promise. These APIs can be used using * `then(...)/catch(...)` * * A Syslog class with a configured - * Syslog server target can also be used as the input into the formating - * classes so that it may run independtly. + * Syslog server target can also be used as the input into the formatting + * classes so that it may run independently. * - * The RFC5424 Syslog logging format is ment to be used as a stream of log data - * from a service or applacation. This class is designed to be used in this - * fashion where new messages are writen to the class as needed. + * The RFC5424 Syslog logging format is meant to be used as a stream of log data + * from a service or application. This class is designed to be used in this + * fashion where new messages are written to the class as needed. * @requires moment * @version 0.0.0 * @since 0.0.0 */ class RFC5424 { /** - * Construct a new RFC5424 formated Syslog object with user options + * Construct a new RFC5424 formatted Syslog object with user options * @public * @this RFC5424 * @param {object} [options] - Options object - * @param {string} [options.applacationName='NodeJSLogger'] - Applacation + * @param {string} [options.applacationName='NodeJSLogger'] - Application * @param {string} [options.hostname=os.hostname] - The name of this server * @param {boolean} [options.timestamp=false] - Included a Timestamp - * @param {boolean} [options.timestampUTC=false] - RFC tandard is for + * @param {boolean} [options.timestampUTC=false] - RFC standard is for * local time * @param {boolean} [options.timestampMS=false] - Timestamp with ms - * resoltuion + * resolution * @param {boolean} [options.timestampTZ=true] - Should the timestamp - * included timezone + * included time zone * @param {boolean} [options.encludeStructuredData=false] - Included * any provided structured data * @param {boolean} [options.utf8BOM=true] - Included the UTF8 @@ -1047,7 +1046,7 @@ class RFC5424 { * @param {boolean} [options.extendedColor=false] - Included the UTF8 * encoding tag with syslog message text * @param {object} [options.colors] - User defended colors for - * severites + * severities * @param {string} [options.colors.emergencyColor] - A RGB Hex coded color in the form * of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 * Extended) @@ -1339,7 +1338,7 @@ class RFC5424 { }); } /** - * Building a formated message. Returns a promise with a formated message + * Building a formatted message. Returns a promise with a formatted message * @public * @param {string} msg - The Syslog Message * @param {object} [options] - Options object @@ -1350,12 +1349,12 @@ class RFC5424 { * this message * @param {string[]} [options.structuredData] - An array of structure * data strings conforming to the IETF/IANA defined SD-IDs or IANA - * registred SMI Network Management Private Enterprise Code SD-ID + * registered SMI Network Management Private Enterprise Code SD-ID * conforming to the format * [name@ parameter=value] * @param {number} [options.colorCode=36] - The ANSI color code to use if * message coloration is selected - * @returns {Promise} A Syslog formated string acording to the selected RFC + * @returns {Promise} A Syslog formatted string according to the selected RFC * @throws {Error} A standard error object */ buildMessage (msg, options) { @@ -1381,7 +1380,7 @@ class RFC5424 { // The PRI is common to both RFC formats const pri = (facility * 8) + severity; // Remove any newline character - msg = msg.replace(newLineRegEx, ''); + msg = msg.replace(newLineRegEx, ''); // Add requested color if (this.color) { options.msgColor = options.msgColor || 36; @@ -1393,7 +1392,7 @@ class RFC5424 { colorCode += options.msgColor; colorCode += 'm'; // ANSI Color Closer } else { - colorCode = '[39m'; // Use terminal's defualt color + colorCode = '[39m'; // Use terminal's default color } msg = escapeCode + colorCode + msg + resetColor; } @@ -1440,7 +1439,7 @@ class RFC5424 { timeQuality += ']'; msgStructuredData.push(timeQuality); } - // Build Structured Data string + //Build Structured Data string let structuredData = '-'; const sdElementCount = msgStructuredData.length; if (this.encludeStructuredData && sdElementCount > 0) { @@ -1480,13 +1479,13 @@ class RFC5424 { }); } /** - * send a RFC5424 formated message. Returns a promise with the formated + * send a RFC5424 formatted message. Returns a promise with the formatted * message that was sent. If no server connection was defined when the - * class was created a defualt Syslog connector will be used. + * class was created a default Syslog connector will be used. * @see SyslogPro~Syslog * @public - * @param {string} msg - The unformated Syslog message to send - * @returns {Promise} A Syslog formated string acording to the selected RFC + * @param {string} msg - The unformatted Syslog message to send + * @returns {Promise} A Syslog formatted string according to the selected RFC * @throws {Error} A standard error object */ send (msg, options) { @@ -1510,11 +1509,11 @@ class RFC5424 { }); } /** - * Send a syslog message with a secerity level of 0 (Emergency) + * Send a syslog message with a severity level of 0 (Emergency) * @public - * @param {string} msg - The emergancy message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @param {string} msg - The emergency message to send to the Syslog server + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ emergency (msg) { return this.send(msg, { @@ -1523,21 +1522,21 @@ class RFC5424 { }); } /** - * Send a syslog message with a secerity level of 0 (Emergency) + * Send a syslog message with a severity level of 0 (Emergency) * @public - * @param {string} msg - The emergancy message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @param {string} msg - The emergency message to send to the Syslog server + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ emer (msg) { return this.emergency(msg); } /** - * Send a syslog message with a secerity level of 1 (Alert) + * Send a syslog message with a severity level of 1 (Alert) * @public * @param {string} msg - The alert message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ alert (msg) { return this.send(msg, { @@ -1546,11 +1545,11 @@ class RFC5424 { }); } /** - * Send a syslog message with a secerity level of 2 (Critical) + * Send a syslog message with a severity level of 2 (Critical) * @public * @param {string} msg - The critical message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ critical (msg) { return this.send(msg, { @@ -1559,21 +1558,21 @@ class RFC5424 { }); } /** - * Send a syslog message with a secerity level of 2 (Critical) + * Send a syslog message with a severity level of 2 (Critical) * @public * @param {string} msg - The critical message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ crit (msg) { return this.critical(msg); } /** - * Send a syslog message with a secerity level of 3 (Error) + * Send a syslog message with a severity level of 3 (Error) * @public * @param {string} msg - The error message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ error (msg) { return this.send(msg, { @@ -1582,21 +1581,21 @@ class RFC5424 { }); } /** - * Send a syslog message with a secerity level of 3 (Error) + * Send a syslog message with a severity level of 3 (Error) * @public * @param {string} msg - The error message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ err (msg) { return this.error(msg); } /** - * Send a syslog message with a secerity level of 4 (Warning) + * Send a syslog message with a severity level of 4 (Warning) * @public * @param {string} msg - The warning message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ warning (msg) { return this.send(msg, { @@ -1605,21 +1604,21 @@ class RFC5424 { }); } /** - * Send a syslog message with a secerity level of 4 (Warning) + * Send a syslog message with a severity level of 4 (Warning) * @public * @param {string} msg - The warning message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ warn (msg) { return this.warning(msg); } /** - * Send a syslog message with a secerity level of 5 (Notice) + * Send a syslog message with a severity level of 5 (Notice) * @public * @param {string} msg - The notice message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ notice (msg) { return this.send(msg, { @@ -1628,21 +1627,21 @@ class RFC5424 { }); } /** - * Send a syslog message with a secerity level of 5 (Notice) + * Send a syslog message with a severity level of 5 (Notice) * @public * @param {string} msg - The notice message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ note (msg) { return this.notice(msg); } /** - * Send a syslog message with a secerity level of 6 (Informational) + * Send a syslog message with a severity level of 6 (Informational) * @public * @param {string} msg - The informational message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ informational (msg) { return this.send(msg, { @@ -1651,31 +1650,31 @@ class RFC5424 { }); } /** - * Send a syslog message with a secerity level of 6 (Informational) + * Send a syslog message with a severity level of 6 (Informational) * @public * @param {string} msg - The informational message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ info (msg) { return this.informational(msg); } /** - * Send a syslog message with a secerity level of 6 (Informational) + * Send a syslog message with a severity level of 6 (Informational) * @public * @param {string} msg - The informational message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ log (msg) { return this.informational(msg); } /** - * Send a syslog message with a secerity level of 7 (Debug) + * Send a syslog message with a severity level of 7 (Debug) * @public * @param {string} msg - The debug message to send to the Syslog server - * @returns {Promise} - The formated syslog message sent to the Syslog server - * @throws {Error} - Any bubbled up error + * @returns {Promise} - The formatted syslog message sent to the Syslog server + * @throws {Error} - Any bubbled-up error */ debug (msg) { return this.send(msg, { @@ -1689,34 +1688,34 @@ class RFC5424 { * A class to work with IBM LEEF (Log Event Extended Format) messages this form * of system messages are designed to work with security systems. Messages can * be saved to file (Saving to file if not part of this module but a LEEF - * formated mesage produced by this module can be saved externaly to it) or + * formatted message produced by this module can be saved externally to it) or * sent via Syslog. * Most APIs will return a promise. These APIs can be used using * `then(...)/catch(...)` * * A Syslog class with a configured Syslog server target can also be used as - * the input into the formating classes so that it may run independtly. The + * the input into the formatting classes so that it may run independently. The * LEEF format is designed to send event data to a SIEM system and should not - * be as a logging stream. This class is ment to be used once per message. + * be as a logging stream. This class is meant to be used once per message. * @requires moment * @version 0.0.0 * @since 0.0.0 */ class LEEF { /** - * Construct a new LEEF formating object with user options + * Construct a new LEEF formatting object with user options * @public * @param {object} [options] - Options object * @param {string} [options.vendor='unknown'] - The vendor of the system that - * genrated the event being reported + * generated the event being reported * @param {string} [options.product='unknown'] - The product name of the * system that genrated the event being reported * @param {string} [options.version='unknown'] - The version name of the * system that genrated the event being reported * @param {string} [options.eventId='unknown'] - The eventId of the * system that genrated the event being reported - * @param {object} [options.attrabute] - LEEF message attrabutes which - * defualts to all base attrabutes with null values, new attrabutes should + * @param {object} [options.attributes] - LEEF message attributes which + * defaults to all base attributes with null values, new attributes should * be added as new elements to this object * @param {boolean} [options.syslogHeader='true'] - Should the LEEF message * include a Syslog header with Timestamp and source @@ -1740,7 +1739,7 @@ class LEEF { this.syslogHeader = typeof options.syslogHeader === 'boolean' ? options.syslogHeader : true; /** @type {object} */ - this.attrabutes = options.attrabutes || { + this.attributes = options.attributes || { cat: null, devTime: null, devTimeFormat: null, @@ -1798,9 +1797,9 @@ class LEEF { } } /** - *Build a formated message + *Build a formatted message * @public - * @return {Promise} - string with formated message + * @return {Promise} - string with formatted message */ buildMessage () { return new Promise((resolve, reject) => { @@ -1811,9 +1810,9 @@ class LEEF { fmtMsg += '|' + this.eventId; fmtMsg += '|'; - // Build LEEF Attrabuites + // Build LEEF Attributes const Tab = '\x09'; - const leefAttribs = Object.entries(this.attrabutes); + const leefAttribs = Object.entries(this.attributes); const leefAttribsLen = leefAttribs.length; for (let attrib = 0; attrib < leefAttribsLen; attrib++) { if (leefAttribs[attrib][1] !== null) { @@ -1853,36 +1852,36 @@ class LEEF { * A class to work with HP CEF (Common Event Format) messages. This form * of system messages are designed to work with security systems. Messages can * be saved to file (Saving to file if not part of this module but a CEF - * formated mesage produced by this module can be saved externaly to it) or + * formatted message produced by this module can be saved externally to it) or * sent via Syslog. * Most APIs will return a promise. These APIs can be used using * `then(...)/catch(...)` * * A Syslog class with a configured Syslog server target can also be used as - * the input into the formating classes so that it may run independtly. The CEF + * the input into the formatting classes so that it may run independently. The CEF * format is designed to send event data to a SIEM system and should not be as - * a logging stream. This class is ment to be used once per message. + * a logging stream. This class is meant to be used once per message. * @requires moment * @version 0.0.0 * @since 0.0.0 */ class CEF { /** - * Construct a new CEF formating object with user options + * Construct a new CEF formatting object with user options * @public * @param {object} [options] - Options object * @param {string} [options.deviceVendor='unknown'] - The vendor of the system - * that genrated the event being reported + * that generated the event being reported * @param {string} [options.deviceProduct='unknown'] - The product name of the * system that genrated the event being reported * @param {string} [options.deviceVersion='unknown'] - The version name of the * system that genrated the event being reported * @param {string} [options.deviceEventClassId='unknown'] - The eventId of the * system that genrated the event being reported - * @param {string} [options.name='unknown'] - Name of the service genrating + * @param {string} [options.name='unknown'] - Name of the service generating * the notice * @param {string} [options.severity='unknown'] - Severity of the notification - * @param {string} [options.extensions={}] - Any CEF Key=Value extentions + * @param {string} [options.extensions={}] - Any CEF Key=Value extensions * @param {Syslog} [options.server=false] - A {@link module:SyslogPro~Syslog| * Syslog server connection} that should be used to send messages directly * from this class. @see SyslogPro~Syslog @@ -2075,8 +2074,8 @@ class CEF { /** * Validate this CEF object * @public - * @return {Promise} - True if valadated - * @throws {Error} - First element to fail valadation + * @return {Promise} - True if validated + * @throws {Error} - First element to fail validation */ validate () { return new Promise ((resolve, reject) => { @@ -2359,4 +2358,5 @@ module.exports = { LEEF: LEEF, CEF: CEF, Syslog: Syslog -}; \ No newline at end of file +}; + diff --git a/tests/syslog.test.js b/tests/syslog.test.js index be16f9e..b501396 100644 --- a/tests/syslog.test.js +++ b/tests/syslog.test.js @@ -225,7 +225,7 @@ describe('LEEF Class Tests', () => { version: 'qweq', eventId: 'et', syslogHeader: false, - attrabutes: { + attributes: { cat: 'net' }, server: syslog @@ -1171,7 +1171,7 @@ describe('Base Syslog Class tests', () => { console.log(result); }) .catch((reson) => { - let errorMsg = 'TYPE ERROR: Server Cert file loctions shoudl be a'; + let errorMsg = 'TYPE ERROR: Server Cert file locations should be a'; errorMsg += ' string or array of strings'; expect(reson.message).toBe(errorMsg); done(); @@ -1251,7 +1251,7 @@ describe('Base Syslog Class tests', () => { console.log(result); }) .catch((reson) => { - let errorMsg = 'FORMAT ERROR: Protocol not reconized, should be '; + let errorMsg = 'FORMAT ERROR: Protocol not recognized, should be '; errorMsg += 'udp|tcp|tls'; expect(reson.message).toBe(errorMsg); done();