updated documents

This commit is contained in:
Craig Yamato 2018-09-25 19:12:40 +00:00
parent eb3d0b5470
commit 1b83a3e15d
14 changed files with 1292 additions and 1316 deletions

View File

@ -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

View File

@ -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 <craig@kentik.com>
@ -94,7 +94,7 @@ classes so that they may run independtly.
* [.version](#module_SyslogPro..LEEF+version) : <code>string</code>
* [.eventId](#module_SyslogPro..LEEF+eventId) : <code>string</code>
* [.syslogHeader](#module_SyslogPro..LEEF+syslogHeader) : <code>boolean</code>
* [.attrabutes](#module_SyslogPro..LEEF+attrabutes) : <code>object</code>
* [.attributes](#module_SyslogPro..LEEF+attributes) : <code>object</code>
* [.buildMessage()](#module_SyslogPro..LEEF+buildMessage) ⇒ <code>Promise</code>
* [.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 [<code>SyslogPro</code>](#module_SyslogPro)
**Requires**: <code>module:moment</code>
@ -148,19 +148,19 @@ Construct a new Syslog transport object with user options
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| [options] | <code>object</code> | | Options object >>>Transport Configuraton |
| [options.target] | <code>string</code> | <code>&quot;&#x27;localhost&#x27;&quot;</code> | 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] | <code>string</code> | <code>&quot;&#x27;udp&#x27;&quot;</code> | L4 transport portocol (udp|tcp|tls), this option if set will take prasdents over any transport set in a formating object |
| [options.port] | <code>number</code> | <code>514</code> | IP port, this option if set will take prasdents over any IP Port set in a formating object |
| [options.tcpTimeout] | <code>number</code> | <code>10000</code> | Ignored for all other transports, this option if set will take prasdents over any timeout set in a formating object |
| [options.tlsServerCerts] | <code>Array.&lt;string&gt;</code> | | 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] | <code>string</code> | | 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] | <code>string</code> | | 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] | <code>object</code> | | Options object >>>Transport Configuration |
| [options.target] | <code>string</code> | <code>&quot;&#x27;localhost&#x27;&quot;</code> | 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] | <code>string</code> | <code>&quot;&#x27;udp&#x27;&quot;</code> | L4 transport protocol (udp|tcp|tls), this option if set will take presidents over any transport set in a formatting object |
| [options.port] | <code>number</code> | <code>514</code> | IP port, this option if set will take presidents over any IP Port set in a formatting object |
| [options.tcpTimeout] | <code>number</code> | <code>10000</code> | Ignored for all other transports, this option if set will take presidents over any timeout set in a formatting object |
| [options.tlsServerCerts] | <code>Array.&lt;string&gt;</code> | | 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] | <code>string</code> | | 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] | <code>string</code> | | 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] | <code>string</code> | <code>&quot;&#x27;none&#x27;&quot;</code> | Valid syslog format options for this module are 'none', 'rfc3164', 'rfc5424', 'leef', 'cef' |
| [options.rfc5424] | <code>RFC3164</code> | | {@link module:SyslogPro~RFC5424| RFC5424 related settings} |
| [options.rfc5424] | <code>RFC5424</code> | | {@link module:SyslogPro~RFC5424| RFC5424 related settings} |
| [options.leef] | <code>LEEF</code> | | {@link module:SyslogPro~LEEF|IBM LEEF (Log Event Extended Format) object} |
| [options.cef] | <code>CEF</code> | | {@link module:SyslogPro~CEF|HP CEF (Common Event Format) formating object} |
| [options.cef] | <code>CEF</code> | | {@link module:SyslogPro~CEF|HP CEF (Common Event Format) formatting object} |
<a name="module_SyslogPro..Syslog+target"></a>
@ -213,18 +213,18 @@ Construct a new Syslog transport object with user options
<a name="module_SyslogPro..RFC3164"></a>
### 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 [<code>SyslogPro</code>](#module_SyslogPro)
**Requires**: <code>module:moment</code>
@ -257,18 +257,18 @@ fashion where new messages are writen to the class as needed.
<a name="new_module_SyslogPro..RFC3164_new"></a>
#### 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] | <code>object</code> | | Options object |
| [options.applacationName] | <code>string</code> | <code>&quot;&#x27;NodeJSLogger&#x27;&quot;</code> | Applacation |
| [options.applacationName] | <code>string</code> | <code>&quot;&#x27;NodeJSLogger&#x27;&quot;</code> | Application |
| [options.hostname] | <code>string</code> | <code>&quot;os.hostname&quot;</code> | The name of this server |
| [options.facility] | <code>number</code> | <code>23</code> | Facility code to use sending this message |
| [options.color] | <code>boolean</code> | <code>false</code> | Apply color coding encoding tag with syslog message text |
| [options.extendedColor] | <code>boolean</code> | <code>false</code> | Use the extedned ANSI color set encoding tag with syslog message text |
| [options.colors] | <code>object</code> | | User defended colors for severites |
| [options.extendedColor] | <code>boolean</code> | <code>false</code> | Use the extended ANSI color set encoding tag with syslog message text |
| [options.colors] | <code>object</code> | | User defended colors for severities |
| [options.colors.emergencyColor] | <code>string</code> | | 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] | <code>string</code> | | 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] | <code>string</code> | | 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
<a name="module_SyslogPro..RFC3164+buildMessage"></a>
#### rfC3164.buildMessage(msg, [options]) ⇒ <code>Promise</code>
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 [<code>RFC3164</code>](#module_SyslogPro..RFC3164)
**Returns**: <code>Promise</code> - A Syslog formated string acording to the selected RFC
**Returns**: <code>Promise</code> - A Syslog formatted string according to the selected RFC
**Throws**:
- <code>Error</code> A standard error object
@ -333,12 +333,12 @@ Building a formated message. Returns a promise with a formated message
<a name="module_SyslogPro..RFC3164+send"></a>
#### rfC3164.send(msg, [options]) ⇒ <code>Promise</code>
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 [<code>RFC3164</code>](#module_SyslogPro..RFC3164)
**Returns**: <code>Promise</code> - A Syslog formated string acording to the selected RFC
**Returns**: <code>Promise</code> - A Syslog formatted string according to the selected RFC
**Throws**:
- <code>Error</code> A standard error object
@ -348,7 +348,7 @@ send a RFC5424 formated message. Returns a promise with the formated
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| msg | <code>string</code> | | The unformated Syslog message to send |
| msg | <code>string</code> | | The unformatted Syslog message to send |
| [options] | <code>object</code> | | Options object |
| [options.severity] | <code>number</code> | <code>7</code> | An array of structure |
| [options.colorCode] | <code>number</code> | <code>36</code> | The ANSI color code to use if |
@ -356,47 +356,47 @@ send a RFC5424 formated message. Returns a promise with the formated
<a name="module_SyslogPro..RFC3164+emergency"></a>
#### rfC3164.emergency(msg) ⇒ <code>Promise</code>
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 [<code>RFC3164</code>](#module_SyslogPro..RFC3164)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
| Param | Type | Description |
| --- | --- | --- |
| msg | <code>string</code> | The emergancy message to send to the Syslog server |
| msg | <code>string</code> | The emergency message to send to the Syslog server |
<a name="module_SyslogPro..RFC3164+emer"></a>
#### rfC3164.emer(msg) ⇒ <code>Promise</code>
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 [<code>RFC3164</code>](#module_SyslogPro..RFC3164)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
| Param | Type | Description |
| --- | --- | --- |
| msg | <code>string</code> | The emergancy message to send to the Syslog server |
| msg | <code>string</code> | The emergency message to send to the Syslog server |
<a name="module_SyslogPro..RFC3164+alert"></a>
#### rfC3164.alert(msg) ⇒ <code>Promise</code>
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 [<code>RFC3164</code>](#module_SyslogPro..RFC3164)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -407,13 +407,13 @@ Send a syslog message with a secerity level of 1 (Alert)
<a name="module_SyslogPro..RFC3164+critical"></a>
#### rfC3164.critical(msg) ⇒ <code>Promise</code>
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 [<code>RFC3164</code>](#module_SyslogPro..RFC3164)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -424,13 +424,13 @@ Send a syslog message with a secerity level of 2 (Critical)
<a name="module_SyslogPro..RFC3164+crit"></a>
#### rfC3164.crit(msg) ⇒ <code>Promise</code>
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 [<code>RFC3164</code>](#module_SyslogPro..RFC3164)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -441,13 +441,13 @@ Send a syslog message with a secerity level of 2 (Critical)
<a name="module_SyslogPro..RFC3164+error"></a>
#### rfC3164.error(msg) ⇒ <code>Promise</code>
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 [<code>RFC3164</code>](#module_SyslogPro..RFC3164)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -458,13 +458,13 @@ Send a syslog message with a secerity level of 3 (Error)
<a name="module_SyslogPro..RFC3164+err"></a>
#### rfC3164.err(msg) ⇒ <code>Promise</code>
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 [<code>RFC3164</code>](#module_SyslogPro..RFC3164)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -475,13 +475,13 @@ Send a syslog message with a secerity level of 3 (Error)
<a name="module_SyslogPro..RFC3164+warning"></a>
#### rfC3164.warning(msg) ⇒ <code>Promise</code>
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 [<code>RFC3164</code>](#module_SyslogPro..RFC3164)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -492,13 +492,13 @@ Send a syslog message with a secerity level of 4 (Warning)
<a name="module_SyslogPro..RFC3164+warn"></a>
#### rfC3164.warn(msg) ⇒ <code>Promise</code>
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 [<code>RFC3164</code>](#module_SyslogPro..RFC3164)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -509,13 +509,13 @@ Send a syslog message with a secerity level of 4 (Warning)
<a name="module_SyslogPro..RFC3164+notice"></a>
#### rfC3164.notice(msg) ⇒ <code>Promise</code>
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 [<code>RFC3164</code>](#module_SyslogPro..RFC3164)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -526,13 +526,13 @@ Send a syslog message with a secerity level of 5 (Notice)
<a name="module_SyslogPro..RFC3164+note"></a>
#### rfC3164.note(msg) ⇒ <code>Promise</code>
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 [<code>RFC3164</code>](#module_SyslogPro..RFC3164)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -543,13 +543,13 @@ Send a syslog message with a secerity level of 5 (Notice)
<a name="module_SyslogPro..RFC3164+informational"></a>
#### rfC3164.informational(msg) ⇒ <code>Promise</code>
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 [<code>RFC3164</code>](#module_SyslogPro..RFC3164)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -560,13 +560,13 @@ Send a syslog message with a secerity level of 6 (Informational)
<a name="module_SyslogPro..RFC3164+info"></a>
#### rfC3164.info(msg) ⇒ <code>Promise</code>
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 [<code>RFC3164</code>](#module_SyslogPro..RFC3164)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -577,13 +577,13 @@ Send a syslog message with a secerity level of 6 (Informational)
<a name="module_SyslogPro..RFC3164+log"></a>
#### rfC3164.log(msg) ⇒ <code>Promise</code>
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 [<code>RFC3164</code>](#module_SyslogPro..RFC3164)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -594,13 +594,13 @@ Send a syslog message with a secerity level of 6 (Informational)
<a name="module_SyslogPro..RFC3164+debug"></a>
#### rfC3164.debug(msg) ⇒ <code>Promise</code>
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 [<code>RFC3164</code>](#module_SyslogPro..RFC3164)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -611,18 +611,18 @@ Send a syslog message with a secerity level of 7 (Debug)
<a name="module_SyslogPro..RFC5424"></a>
### 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 [<code>SyslogPro</code>](#module_SyslogPro)
**Requires**: <code>module:moment</code>
@ -661,23 +661,23 @@ fashion where new messages are writen to the class as needed.
<a name="new_module_SyslogPro..RFC5424_new"></a>
#### 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] | <code>object</code> | | Options object |
| [options.applacationName] | <code>string</code> | <code>&quot;&#x27;NodeJSLogger&#x27;&quot;</code> | Applacation |
| [options.applacationName] | <code>string</code> | <code>&quot;&#x27;NodeJSLogger&#x27;&quot;</code> | Application |
| [options.hostname] | <code>string</code> | <code>&quot;os.hostname&quot;</code> | The name of this server |
| [options.timestamp] | <code>boolean</code> | <code>false</code> | Included a Timestamp |
| [options.timestampUTC] | <code>boolean</code> | <code>false</code> | RFC tandard is for local time |
| [options.timestampMS] | <code>boolean</code> | <code>false</code> | Timestamp with ms resoltuion |
| [options.timestampUTC] | <code>boolean</code> | <code>false</code> | RFC standard is for local time |
| [options.timestampMS] | <code>boolean</code> | <code>false</code> | Timestamp with ms resolution |
| [options.timestampTZ] | <code>boolean</code> | <code>true</code> | Should the timestamp included time zone |
| [options.encludeStructuredData] | <code>boolean</code> | <code>false</code> | Included any provided structured data |
| [options.utf8BOM] | <code>boolean</code> | <code>true</code> | Included the UTF8 |
| [options.color] | <code>boolean</code> | <code>false</code> | Included the UTF8 |
| [options.extendedColor] | <code>boolean</code> | <code>false</code> | Included the UTF8 encoding tag with syslog message text |
| [options.colors] | <code>object</code> | | User defended colors for severites |
| [options.colors] | <code>object</code> | | User defended colors for severities |
| [options.colors.emergencyColor] | <code>string</code> | | 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] | <code>string</code> | | 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] | <code>string</code> | | 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
<a name="module_SyslogPro..RFC5424+buildMessage"></a>
#### rfC5424.buildMessage(msg, [options]) ⇒ <code>Promise</code>
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 [<code>RFC5424</code>](#module_SyslogPro..RFC5424)
**Returns**: <code>Promise</code> - A Syslog formated string acording to the selected RFC
**Returns**: <code>Promise</code> - A Syslog formatted string according to the selected RFC
**Throws**:
- <code>Error</code> A standard error object
@ -763,18 +763,18 @@ Building a formated message. Returns a promise with a formated message
| [options.severity] | <code>number</code> | <code>7</code> | An array of structure |
| [options.facility] | <code>number</code> | <code>23</code> | Facility code to use sending this message |
| [options.pid] | <code>string</code> | <code>&quot;&#x27;-&#x27;&quot;</code> | The process id of the service sending this message |
| [options.structuredData] | <code>Array.&lt;string&gt;</code> | | 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@<private enterprise number> parameter=value] |
| [options.structuredData] | <code>Array.&lt;string&gt;</code> | | 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@<private enterprise number> parameter=value] |
| [options.colorCode] | <code>number</code> | <code>36</code> | The ANSI color code to use if message coloration is selected |
<a name="module_SyslogPro..RFC5424+send"></a>
#### rfC5424.send(msg) ⇒ <code>Promise</code>
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 [<code>RFC5424</code>](#module_SyslogPro..RFC5424)
**Returns**: <code>Promise</code> - A Syslog formated string acording to the selected RFC
**Returns**: <code>Promise</code> - A Syslog formatted string according to the selected RFC
**Throws**:
- <code>Error</code> A standard error object
@ -784,52 +784,52 @@ send a RFC5424 formated message. Returns a promise with the formated
| Param | Type | Description |
| --- | --- | --- |
| msg | <code>string</code> | The unformated Syslog message to send |
| msg | <code>string</code> | The unformatted Syslog message to send |
<a name="module_SyslogPro..RFC5424+emergency"></a>
#### rfC5424.emergency(msg) ⇒ <code>Promise</code>
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 [<code>RFC5424</code>](#module_SyslogPro..RFC5424)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
| Param | Type | Description |
| --- | --- | --- |
| msg | <code>string</code> | The emergancy message to send to the Syslog server |
| msg | <code>string</code> | The emergency message to send to the Syslog server |
<a name="module_SyslogPro..RFC5424+emer"></a>
#### rfC5424.emer(msg) ⇒ <code>Promise</code>
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 [<code>RFC5424</code>](#module_SyslogPro..RFC5424)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
| Param | Type | Description |
| --- | --- | --- |
| msg | <code>string</code> | The emergancy message to send to the Syslog server |
| msg | <code>string</code> | The emergency message to send to the Syslog server |
<a name="module_SyslogPro..RFC5424+alert"></a>
#### rfC5424.alert(msg) ⇒ <code>Promise</code>
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 [<code>RFC5424</code>](#module_SyslogPro..RFC5424)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -840,13 +840,13 @@ Send a syslog message with a secerity level of 1 (Alert)
<a name="module_SyslogPro..RFC5424+critical"></a>
#### rfC5424.critical(msg) ⇒ <code>Promise</code>
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 [<code>RFC5424</code>](#module_SyslogPro..RFC5424)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -857,13 +857,13 @@ Send a syslog message with a secerity level of 2 (Critical)
<a name="module_SyslogPro..RFC5424+crit"></a>
#### rfC5424.crit(msg) ⇒ <code>Promise</code>
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 [<code>RFC5424</code>](#module_SyslogPro..RFC5424)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -874,13 +874,13 @@ Send a syslog message with a secerity level of 2 (Critical)
<a name="module_SyslogPro..RFC5424+error"></a>
#### rfC5424.error(msg) ⇒ <code>Promise</code>
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 [<code>RFC5424</code>](#module_SyslogPro..RFC5424)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -891,13 +891,13 @@ Send a syslog message with a secerity level of 3 (Error)
<a name="module_SyslogPro..RFC5424+err"></a>
#### rfC5424.err(msg) ⇒ <code>Promise</code>
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 [<code>RFC5424</code>](#module_SyslogPro..RFC5424)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -908,13 +908,13 @@ Send a syslog message with a secerity level of 3 (Error)
<a name="module_SyslogPro..RFC5424+warning"></a>
#### rfC5424.warning(msg) ⇒ <code>Promise</code>
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 [<code>RFC5424</code>](#module_SyslogPro..RFC5424)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -925,13 +925,13 @@ Send a syslog message with a secerity level of 4 (Warning)
<a name="module_SyslogPro..RFC5424+warn"></a>
#### rfC5424.warn(msg) ⇒ <code>Promise</code>
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 [<code>RFC5424</code>](#module_SyslogPro..RFC5424)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -942,13 +942,13 @@ Send a syslog message with a secerity level of 4 (Warning)
<a name="module_SyslogPro..RFC5424+notice"></a>
#### rfC5424.notice(msg) ⇒ <code>Promise</code>
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 [<code>RFC5424</code>](#module_SyslogPro..RFC5424)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -959,13 +959,13 @@ Send a syslog message with a secerity level of 5 (Notice)
<a name="module_SyslogPro..RFC5424+note"></a>
#### rfC5424.note(msg) ⇒ <code>Promise</code>
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 [<code>RFC5424</code>](#module_SyslogPro..RFC5424)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -976,13 +976,13 @@ Send a syslog message with a secerity level of 5 (Notice)
<a name="module_SyslogPro..RFC5424+informational"></a>
#### rfC5424.informational(msg) ⇒ <code>Promise</code>
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 [<code>RFC5424</code>](#module_SyslogPro..RFC5424)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -993,13 +993,13 @@ Send a syslog message with a secerity level of 6 (Informational)
<a name="module_SyslogPro..RFC5424+info"></a>
#### rfC5424.info(msg) ⇒ <code>Promise</code>
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 [<code>RFC5424</code>](#module_SyslogPro..RFC5424)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -1010,13 +1010,13 @@ Send a syslog message with a secerity level of 6 (Informational)
<a name="module_SyslogPro..RFC5424+log"></a>
#### rfC5424.log(msg) ⇒ <code>Promise</code>
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 [<code>RFC5424</code>](#module_SyslogPro..RFC5424)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - Any bubbled-up error
**Access**: public
@ -1027,13 +1027,13 @@ Send a syslog message with a secerity level of 6 (Informational)
<a name="module_SyslogPro..RFC5424+debug"></a>
#### rfC5424.debug(msg) ⇒ <code>Promise</code>
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 [<code>RFC5424</code>](#module_SyslogPro..RFC5424)
**Returns**: <code>Promise</code> - - The formated syslog message sent to the Syslog server
**Returns**: <code>Promise</code> - - The formatted syslog message sent to the Syslog server
**Throws**:
- <code>Error</code> - Any bubbled up error
- <code>Error</code> - 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 [<code>SyslogPro</code>](#module_SyslogPro)
**Requires**: <code>module:moment</code>
@ -1069,24 +1069,24 @@ be as a logging stream. This class is ment to be used once per message.
* [.version](#module_SyslogPro..LEEF+version) : <code>string</code>
* [.eventId](#module_SyslogPro..LEEF+eventId) : <code>string</code>
* [.syslogHeader](#module_SyslogPro..LEEF+syslogHeader) : <code>boolean</code>
* [.attrabutes](#module_SyslogPro..LEEF+attrabutes) : <code>object</code>
* [.attributes](#module_SyslogPro..LEEF+attributes) : <code>object</code>
* [.buildMessage()](#module_SyslogPro..LEEF+buildMessage) ⇒ <code>Promise</code>
* [.send([options])](#module_SyslogPro..LEEF+send)
<a name="new_module_SyslogPro..LEEF_new"></a>
#### 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] | <code>object</code> | | Options object |
| [options.vendor] | <code>string</code> | <code>&quot;&#x27;unknown&#x27;&quot;</code> | The vendor of the system that genrated the event being reported |
| [options.vendor] | <code>string</code> | <code>&quot;&#x27;unknown&#x27;&quot;</code> | The vendor of the system that generated the event being reported |
| [options.product] | <code>string</code> | <code>&quot;&#x27;unknown&#x27;&quot;</code> | The product name of the system that genrated the event being reported |
| [options.version] | <code>string</code> | <code>&quot;&#x27;unknown&#x27;&quot;</code> | The version name of the system that genrated the event being reported |
| [options.eventId] | <code>string</code> | <code>&quot;&#x27;unknown&#x27;&quot;</code> | The eventId of the system that genrated the event being reported |
| [options.attrabute] | <code>object</code> | | 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] | <code>object</code> | | 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] | <code>boolean</code> | <code>&#x27;true&#x27;</code> | Should the LEEF message include a Syslog header with Timestamp and source |
| [options.server] | <code>Syslog</code> | <code>false</code> | 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 : <code>boolean</code>
**Kind**: instance property of [<code>LEEF</code>](#module_SyslogPro..LEEF)
<a name="module_SyslogPro..LEEF+attrabutes"></a>
<a name="module_SyslogPro..LEEF+attributes"></a>
#### leeF.attrabutes : <code>object</code>
#### leeF.attributes : <code>object</code>
**Kind**: instance property of [<code>LEEF</code>](#module_SyslogPro..LEEF)
<a name="module_SyslogPro..LEEF+buildMessage"></a>
#### leeF.buildMessage() ⇒ <code>Promise</code>
Build a formated message
Build a formatted message
**Kind**: instance method of [<code>LEEF</code>](#module_SyslogPro..LEEF)
**Returns**: <code>Promise</code> - - string with formated message
**Returns**: <code>Promise</code> - - string with formatted message
**Access**: public
<a name="module_SyslogPro..LEEF+send"></a>
@ -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 [<code>SyslogPro</code>](#module_SyslogPro)
**Requires**: <code>module:moment</code>
@ -1169,19 +1169,19 @@ a logging stream. This class is ment to be used once per message.
<a name="new_module_SyslogPro..CEF_new"></a>
#### 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] | <code>object</code> | | Options object |
| [options.deviceVendor] | <code>string</code> | <code>&quot;&#x27;unknown&#x27;&quot;</code> | The vendor of the system that genrated the event being reported |
| [options.deviceVendor] | <code>string</code> | <code>&quot;&#x27;unknown&#x27;&quot;</code> | The vendor of the system that generated the event being reported |
| [options.deviceProduct] | <code>string</code> | <code>&quot;&#x27;unknown&#x27;&quot;</code> | The product name of the system that genrated the event being reported |
| [options.deviceVersion] | <code>string</code> | <code>&quot;&#x27;unknown&#x27;&quot;</code> | The version name of the system that genrated the event being reported |
| [options.deviceEventClassId] | <code>string</code> | <code>&quot;&#x27;unknown&#x27;&quot;</code> | The eventId of the system that genrated the event being reported |
| [options.name] | <code>string</code> | <code>&quot;&#x27;unknown&#x27;&quot;</code> | Name of the service genrating the notice |
| [options.name] | <code>string</code> | <code>&quot;&#x27;unknown&#x27;&quot;</code> | Name of the service generating the notice |
| [options.severity] | <code>string</code> | <code>&quot;&#x27;unknown&#x27;&quot;</code> | Severity of the notification |
| [options.extensions] | <code>string</code> | <code>&quot;{}&quot;</code> | Any CEF Key=Value extentions |
| [options.extensions] | <code>string</code> | <code>&quot;{}&quot;</code> | Any CEF Key=Value extensions |
| [options.server] | <code>Syslog</code> | <code>false</code> | A {@link module:SyslogPro~Syslog| Syslog server connection} that should be used to send messages directly from this class. @see SyslogPro~Syslog |
<a name="module_SyslogPro..CEF+deviceVendor"></a>
@ -1218,10 +1218,10 @@ Construct a new CEF formating object with user options
Validate this CEF object
**Kind**: instance method of [<code>CEF</code>](#module_SyslogPro..CEF)
**Returns**: <code>Promise</code> - - True if valadated
**Returns**: <code>Promise</code> - - True if validated
**Throws**:
- <code>Error</code> - First element to fail valadation
- <code>Error</code> - First element to fail validation
**Access**: public
<a name="module_SyslogPro..CEF+buildMessage"></a>

View File

@ -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 <craig@kentik.com>
* @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
*/
@ -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';
@ -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
@ -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,35 +1213,35 @@ 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 time zone
* @param {boolean} [options.encludeStructuredData=false] - Included
@ -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@<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) {
@ -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
};
```

File diff suppressed because it is too large Load Diff

View File

@ -81,8 +81,8 @@ and the <a href="https://nodejs.org/api/dns.html#dns_dns_promises_api">DNS Promi
protocol: 'udp',
format: 'rfc5424'
});
syslog.rfc5424.info('My Message');</code></pre><p> Optionaly you can create each class or class options to pass to SyslogPro
to create formated messages or use directly</p>
syslog.rfc5424.info('My Message');</code></pre><p>Optionally you can create each class or class options to pass to SyslogPro to
create formatted messages or use directly</p>
<p><strong>RFC3164</strong></p>
<pre class="prettyprint source lang-js"><code> let rfc3164 = new SyslogPro.RFC3164({
applacationName: 'MyApp',
@ -142,7 +142,9 @@ and the <a href="https://nodejs.org/api/dns.html#dns_dns_promises_api">DNS Promi
});</code></pre><h2>API</h2><p>For more details see:</p>
<ul>
<li><a href="https://cyamato.github.io/SyslogPro/">JSDoc</a> </li>
<li><a href="./docs/api.md">api.md</a></li>
<li><a href="./docs/api.md">API.md</a></li>
<li><a href="./docs/docco/index.html">Docco.html</a></li>
<li><a href="./docs/docco/README.md">Docco.md</a></li>
</ul>
<h2>Test</h2><pre class="prettyprint source lang-shell"><code> npm test</code></pre><h2>Contributing</h2><p>Please try to maintain the existing coding style. Add unit tests for any new or
changed functionality. Lint and test your code.</p>
@ -165,7 +167,7 @@ changed functionality. Lint and test your code.</p>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Sep 25 2018 18:22:00 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Sep 25 2018 19:11:53 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>
<script>prettyPrint();</script>

View File

@ -41,17 +41,18 @@
<section>
<article>
<pre class="prettyprint source linenums"><code>/** Copyright (c) 2018 Craig Yamato */
<pre class="prettyprint source linenums"><code>// 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 &lt;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 &amp; 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
*/
@ -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 &amp; 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';
@ -822,12 +822,11 @@ 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')
@ -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,35 +1051,35 @@ 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 time zone
* @param {boolean} [options.encludeStructuredData=false] - Included
@ -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 &amp; 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@&lt;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) {
@ -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;
}
@ -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 &lt; 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
};</code></pre>
};
</code></pre>
</article>
</section>
@ -2416,7 +2417,7 @@ module.exports = {
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Sep 25 2018 18:22:00 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Sep 25 2018 19:11:53 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>
<script>prettyPrint();</script>

View File

@ -52,15 +52,15 @@
<div class="class-description">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.</div>
a logging stream. This class is meant to be used once per message.</div>
</header>
@ -87,7 +87,7 @@ a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1869">line 1869</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1868">line 1868</a>
</li></ul></dd>
@ -133,7 +133,7 @@ a logging stream. This class is ment to be used once per message.</div>
<div class="description">
Construct a new CEF formating object with user options
Construct a new CEF formatting object with user options
</div>
@ -262,7 +262,7 @@ a logging stream. This class is ment to be used once per message.</div>
<td class="description last">The vendor of the system
that genrated the event being reported</td>
that generated the event being reported</td>
</tr>
@ -421,7 +421,7 @@ a logging stream. This class is ment to be used once per message.</div>
</td>
<td class="description last">Name of the service genrating
<td class="description last">Name of the service generating
the notice</td>
</tr>
@ -500,7 +500,7 @@ a logging stream. This class is ment to be used once per message.</div>
</td>
<td class="description last">Any CEF Key=Value extentions</td>
<td class="description last">Any CEF Key=Value extensions</td>
</tr>
@ -610,7 +610,7 @@ a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1892">line 1892</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1891">line 1891</a>
</li></ul></dd>
@ -669,7 +669,7 @@ a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1901">line 1901</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1900">line 1900</a>
</li></ul></dd>
@ -738,7 +738,7 @@ a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1897">line 1897</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1896">line 1896</a>
</li></ul></dd>
@ -807,7 +807,7 @@ a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1895">line 1895</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1894">line 1894</a>
</li></ul></dd>
@ -876,7 +876,7 @@ a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1899">line 1899</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1898">line 1898</a>
</li></ul></dd>
@ -945,7 +945,7 @@ a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1907">line 1907</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1906">line 1906</a>
</li></ul></dd>
@ -1014,7 +1014,7 @@ a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1903">line 1903</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1902">line 1902</a>
</li></ul></dd>
@ -1083,7 +1083,7 @@ a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line2069">line 2069</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line2068">line 2068</a>
</li></ul></dd>
@ -1142,7 +1142,7 @@ a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1905">line 1905</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1904">line 1904</a>
</li></ul></dd>
@ -1221,7 +1221,7 @@ a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line2309">line 2309</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line2308">line 2308</a>
</li></ul></dd>
@ -1327,7 +1327,7 @@ a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line2336">line 2336</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line2335">line 2335</a>
</li></ul></dd>
@ -1477,7 +1477,7 @@ a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line2081">line 2081</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line2080">line 2080</a>
</li></ul></dd>
@ -1547,7 +1547,7 @@ a logging stream. This class is ment to be used once per message.</div>
<dl>
<dt>
<div class="param-desc">
- First element to fail valadation
- First element to fail validation
</div>
</dt>
<dd></dd>
@ -1575,7 +1575,7 @@ a logging stream. This class is ment to be used once per message.</div>
<div class="param-desc">
- True if valadated
- True if validated
</div>
@ -1615,7 +1615,7 @@ a logging stream. This class is ment to be used once per message.</div>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Sep 25 2018 18:22:00 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Sep 25 2018 19:11:53 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>
<script>prettyPrint();</script>

View File

@ -52,15 +52,15 @@
<div class="class-description">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.</div>
be as a logging stream. This class is meant to be used once per message.</div>
</header>
@ -87,7 +87,7 @@ be as a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1705">line 1705</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1704">line 1704</a>
</li></ul></dd>
@ -133,7 +133,7 @@ be as a logging stream. This class is ment to be used once per message.</div>
<div class="description">
Construct a new LEEF formating object with user options
Construct a new LEEF formatting object with user options
</div>
@ -262,7 +262,7 @@ be as a logging stream. This class is ment to be used once per message.</div>
<td class="description last">The vendor of the system that
genrated the event being reported</td>
generated the event being reported</td>
</tr>
@ -389,7 +389,7 @@ be as a logging stream. This class is ment to be used once per message.</div>
<tr>
<td class="name"><code>attrabute</code></td>
<td class="name"><code>attributes</code></td>
<td class="type">
@ -419,8 +419,8 @@ be as a logging stream. This class is ment to be used once per message.</div>
</td>
<td class="description last">LEEF message attrabutes which
defualts to all base attrabutes with null values, new attrabutes should
<td class="description last">LEEF message attributes which
defaults to all base attributes with null values, new attributes should
be added as new elements to this object</td>
</tr>
@ -560,7 +560,7 @@ be as a logging stream. This class is ment to be used once per message.</div>
<h4 class="name" id="attrabutes"><span class="type-signature"></span>attrabutes<span class="type-signature"> :object</span></h4>
<h4 class="name" id="attributes"><span class="type-signature"></span>attributes<span class="type-signature"> :object</span></h4>
@ -571,7 +571,7 @@ be as a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1743">line 1743</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1742">line 1742</a>
</li></ul></dd>
@ -640,7 +640,7 @@ be as a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1729">line 1729</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1728">line 1728</a>
</li></ul></dd>
@ -699,7 +699,7 @@ be as a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1738">line 1738</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1737">line 1737</a>
</li></ul></dd>
@ -768,7 +768,7 @@ be as a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1734">line 1734</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1733">line 1733</a>
</li></ul></dd>
@ -837,7 +837,7 @@ be as a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1794">line 1794</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1793">line 1793</a>
</li></ul></dd>
@ -896,7 +896,7 @@ be as a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1740">line 1740</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1739">line 1739</a>
</li></ul></dd>
@ -965,7 +965,7 @@ be as a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1732">line 1732</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1731">line 1731</a>
</li></ul></dd>
@ -1034,7 +1034,7 @@ be as a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1736">line 1736</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1735">line 1735</a>
</li></ul></dd>
@ -1113,7 +1113,7 @@ be as a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1805">line 1805</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1804">line 1804</a>
</li></ul></dd>
@ -1153,7 +1153,7 @@ be as a logging stream. This class is ment to be used once per message.</div>
<div class="description">
Build a formated message
Build a formatted message
</div>
@ -1182,7 +1182,7 @@ be as a logging stream. This class is ment to be used once per message.</div>
<div class="param-desc">
- string with formated message
- string with formatted message
</div>
@ -1219,7 +1219,7 @@ be as a logging stream. This class is ment to be used once per message.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1833">line 1833</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1832">line 1832</a>
</li></ul></dd>
@ -1372,7 +1372,7 @@ be as a logging stream. This class is ment to be used once per message.</div>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Sep 25 2018 18:22:00 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Sep 25 2018 19:11:53 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>
<script>prettyPrint();</script>

View File

@ -49,18 +49,18 @@
RFC3164
</h2>
<div class="class-description">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.
<div class="class-description">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.</div>
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.</div>
</header>
@ -133,7 +133,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Construct a new RFC3164 formated Syslog object with user options
Construct a new RFC3164 formatted Syslog object with user options
</div>
@ -261,7 +261,7 @@ fashion where new messages are writen to the class as needed.</div>
</td>
<td class="description last">Applacation</td>
<td class="description last">Application</td>
</tr>
@ -419,7 +419,7 @@ fashion where new messages are writen to the class as needed.</div>
</td>
<td class="description last">Use the extedned ANSI
<td class="description last">Use the extended ANSI
color set encoding tag with syslog message text</td>
</tr>
@ -458,7 +458,7 @@ fashion where new messages are writen to the class as needed.</div>
<td class="description last">User defended colors for
severites
severities
<h6>Properties</h6>
@ -1614,7 +1614,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line865">line 865</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line864">line 864</a>
</li></ul></dd>
@ -1654,7 +1654,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 1 (Alert)
Send a syslog message with a severity level of 1 (Alert)
</div>
@ -1733,7 +1733,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -1761,7 +1761,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -1838,7 +1838,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Building a formated message. Returns a promise with a formated message
Building a formatted message. Returns a promise with a formatted message
</div>
@ -2097,7 +2097,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
A Syslog formated string acording to the selected RFC
A Syslog formatted string according to the selected RFC
</div>
@ -2134,7 +2134,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line891">line 891</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line890">line 890</a>
</li></ul></dd>
@ -2174,7 +2174,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 2 (Critical)
Send a syslog message with a severity level of 2 (Critical)
</div>
@ -2253,7 +2253,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -2281,7 +2281,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -2318,7 +2318,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line878">line 878</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line877">line 877</a>
</li></ul></dd>
@ -2358,7 +2358,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 2 (Critical)
Send a syslog message with a severity level of 2 (Critical)
</div>
@ -2437,7 +2437,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -2465,7 +2465,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -2502,7 +2502,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1003">line 1003</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1002">line 1002</a>
</li></ul></dd>
@ -2542,7 +2542,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 7 (Debug)
Send a syslog message with a severity level of 7 (Debug)
</div>
@ -2621,7 +2621,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -2649,7 +2649,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -2686,7 +2686,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line855">line 855</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line854">line 854</a>
</li></ul></dd>
@ -2726,7 +2726,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 0 (Emergency)
Send a syslog message with a security level of 0 (Emergency)
</div>
@ -2780,7 +2780,7 @@ fashion where new messages are writen to the class as needed.</div>
<td class="description last">The emergancy message to send to the Syslog server</td>
<td class="description last">The emergency message to send to the Syslog server</td>
</tr>
@ -2805,7 +2805,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -2833,7 +2833,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -2870,7 +2870,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line842">line 842</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line841">line 841</a>
</li></ul></dd>
@ -2910,7 +2910,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 0 (Emergency)
Send a syslog message with a security level of 0 (Emergency)
</div>
@ -2964,7 +2964,7 @@ fashion where new messages are writen to the class as needed.</div>
<td class="description last">The emergancy message to send to the Syslog server</td>
<td class="description last">The emergency message to send to the Syslog server</td>
</tr>
@ -2989,7 +2989,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -3017,7 +3017,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -3054,7 +3054,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line914">line 914</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line913">line 913</a>
</li></ul></dd>
@ -3094,7 +3094,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 3 (Error)
Send a syslog message with a severity level of 3 (Error)
</div>
@ -3173,7 +3173,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -3201,7 +3201,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -3238,7 +3238,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line901">line 901</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line900">line 900</a>
</li></ul></dd>
@ -3278,7 +3278,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 3 (Error)
Send a syslog message with a severity level of 3 (Error)
</div>
@ -3357,7 +3357,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -3385,7 +3385,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -3422,7 +3422,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line983">line 983</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line982">line 982</a>
</li></ul></dd>
@ -3462,7 +3462,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 6 (Informational)
Send a syslog message with a severity level of 6 (Informational)
</div>
@ -3541,7 +3541,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -3569,7 +3569,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -3606,7 +3606,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line970">line 970</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line969">line 969</a>
</li></ul></dd>
@ -3646,7 +3646,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 6 (Informational)
Send a syslog message with a severity level of 6 (Informational)
</div>
@ -3725,7 +3725,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -3753,7 +3753,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -3790,7 +3790,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line993">line 993</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line992">line 992</a>
</li></ul></dd>
@ -3830,7 +3830,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 6 (Informational)
Send a syslog message with a severity level of 6 (Informational)
</div>
@ -3909,7 +3909,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -3937,7 +3937,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -3974,7 +3974,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line960">line 960</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line959">line 959</a>
</li></ul></dd>
@ -4014,7 +4014,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 5 (Notice)
Send a syslog message with a severity level of 5 (Notice)
</div>
@ -4093,7 +4093,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -4121,7 +4121,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -4158,7 +4158,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line947">line 947</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line946">line 946</a>
</li></ul></dd>
@ -4198,7 +4198,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 5 (Notice)
Send a syslog message with a severity level of 5 (Notice)
</div>
@ -4277,7 +4277,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -4305,7 +4305,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -4342,7 +4342,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line815">line 815</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line814">line 814</a>
</li></ul></dd>
@ -4389,9 +4389,9 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
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.
</div>
@ -4455,7 +4455,7 @@ fashion where new messages are writen to the class as needed.</div>
<td class="description last">The unformated Syslog message to send</td>
<td class="description last">The unformatted Syslog message to send</td>
</tr>
@ -4649,7 +4649,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
A Syslog formated string acording to the selected RFC
A Syslog formatted string according to the selected RFC
</div>
@ -5107,7 +5107,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line937">line 937</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line936">line 936</a>
</li></ul></dd>
@ -5147,7 +5147,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 4 (Warning)
Send a syslog message with a severity level of 4 (Warning)
</div>
@ -5226,7 +5226,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -5254,7 +5254,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -5291,7 +5291,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line924">line 924</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line923">line 923</a>
</li></ul></dd>
@ -5331,7 +5331,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 4 (Warning)
Send a syslog message with a severity level of 4 (Warning)
</div>
@ -5410,7 +5410,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -5438,7 +5438,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -5478,7 +5478,7 @@ fashion where new messages are writen to the class as needed.</div>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Sep 25 2018 18:22:00 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Sep 25 2018 19:11:53 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>
<script>prettyPrint();</script>

View File

@ -49,18 +49,18 @@
RFC5424
</h2>
<div class="class-description">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.
<div class="class-description">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.</div>
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.</div>
</header>
@ -87,7 +87,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1028">line 1028</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1027">line 1027</a>
</li></ul></dd>
@ -133,7 +133,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Construct a new RFC5424 formated Syslog object with user options
Construct a new RFC5424 formatted Syslog object with user options
</div>
@ -261,7 +261,7 @@ fashion where new messages are writen to the class as needed.</div>
</td>
<td class="description last">Applacation</td>
<td class="description last">Application</td>
</tr>
@ -378,7 +378,7 @@ fashion where new messages are writen to the class as needed.</div>
</td>
<td class="description last">RFC tandard is for
<td class="description last">RFC standard is for
local time</td>
</tr>
@ -419,7 +419,7 @@ fashion where new messages are writen to the class as needed.</div>
<td class="description last">Timestamp with ms
resoltuion</td>
resolution</td>
</tr>
@ -655,7 +655,7 @@ fashion where new messages are writen to the class as needed.</div>
<td class="description last">User defended colors for
severites
severities
<h6>Properties</h6>
@ -1073,7 +1073,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1145">line 1145</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1144">line 1144</a>
</li></ul></dd>
@ -1132,7 +1132,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1123">line 1123</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1122">line 1122</a>
</li></ul></dd>
@ -1201,7 +1201,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1081">line 1081</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1080">line 1080</a>
</li></ul></dd>
@ -1260,7 +1260,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1147">line 1147</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1146">line 1146</a>
</li></ul></dd>
@ -1319,7 +1319,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1157">line 1157</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1156">line 1156</a>
</li></ul></dd>
@ -1378,7 +1378,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1143">line 1143</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1142">line 1142</a>
</li></ul></dd>
@ -1437,7 +1437,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1111">line 1111</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1110">line 1110</a>
</li></ul></dd>
@ -1506,7 +1506,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1149">line 1149</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1148">line 1148</a>
</li></ul></dd>
@ -1565,7 +1565,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1129">line 1129</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1128">line 1128</a>
</li></ul></dd>
@ -1634,7 +1634,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1155">line 1155</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1154">line 1154</a>
</li></ul></dd>
@ -1693,7 +1693,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1153">line 1153</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1152">line 1152</a>
</li></ul></dd>
@ -1752,7 +1752,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1136">line 1136</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1135">line 1135</a>
</li></ul></dd>
@ -1811,7 +1811,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1087">line 1087</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1086">line 1086</a>
</li></ul></dd>
@ -1880,7 +1880,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1105">line 1105</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1104">line 1104</a>
</li></ul></dd>
@ -1949,7 +1949,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1099">line 1099</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1098">line 1098</a>
</li></ul></dd>
@ -2018,7 +2018,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1093">line 1093</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1092">line 1092</a>
</li></ul></dd>
@ -2087,7 +2087,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1117">line 1117</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1116">line 1116</a>
</li></ul></dd>
@ -2156,7 +2156,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1151">line 1151</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1150">line 1150</a>
</li></ul></dd>
@ -2225,7 +2225,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1542">line 1542</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1541">line 1541</a>
</li></ul></dd>
@ -2265,7 +2265,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 1 (Alert)
Send a syslog message with a severity level of 1 (Alert)
</div>
@ -2344,7 +2344,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -2372,7 +2372,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -2409,7 +2409,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1361">line 1361</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1360">line 1360</a>
</li></ul></dd>
@ -2449,7 +2449,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Building a formated message. Returns a promise with a formated message
Building a formatted message. Returns a promise with a formatted message
</div>
@ -2727,7 +2727,7 @@ fashion where new messages are writen to the class as needed.</div>
<td class="description last">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]</td>
</tr>
@ -2829,7 +2829,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
A Syslog formated string acording to the selected RFC
A Syslog formatted string according to the selected RFC
</div>
@ -2866,7 +2866,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1568">line 1568</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1567">line 1567</a>
</li></ul></dd>
@ -2906,7 +2906,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 2 (Critical)
Send a syslog message with a severity level of 2 (Critical)
</div>
@ -2985,7 +2985,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -3013,7 +3013,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -3050,7 +3050,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1555">line 1555</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1554">line 1554</a>
</li></ul></dd>
@ -3090,7 +3090,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 2 (Critical)
Send a syslog message with a severity level of 2 (Critical)
</div>
@ -3169,7 +3169,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -3197,7 +3197,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -3234,7 +3234,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1680">line 1680</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1679">line 1679</a>
</li></ul></dd>
@ -3274,7 +3274,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 7 (Debug)
Send a syslog message with a severity level of 7 (Debug)
</div>
@ -3353,7 +3353,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -3381,7 +3381,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -3418,7 +3418,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1532">line 1532</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1531">line 1531</a>
</li></ul></dd>
@ -3458,7 +3458,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 0 (Emergency)
Send a syslog message with a severity level of 0 (Emergency)
</div>
@ -3512,7 +3512,7 @@ fashion where new messages are writen to the class as needed.</div>
<td class="description last">The emergancy message to send to the Syslog server</td>
<td class="description last">The emergency message to send to the Syslog server</td>
</tr>
@ -3537,7 +3537,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -3565,7 +3565,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -3602,7 +3602,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1519">line 1519</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1518">line 1518</a>
</li></ul></dd>
@ -3642,7 +3642,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 0 (Emergency)
Send a syslog message with a severity level of 0 (Emergency)
</div>
@ -3696,7 +3696,7 @@ fashion where new messages are writen to the class as needed.</div>
<td class="description last">The emergancy message to send to the Syslog server</td>
<td class="description last">The emergency message to send to the Syslog server</td>
</tr>
@ -3721,7 +3721,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -3749,7 +3749,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -3786,7 +3786,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1591">line 1591</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1590">line 1590</a>
</li></ul></dd>
@ -3826,7 +3826,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 3 (Error)
Send a syslog message with a severity level of 3 (Error)
</div>
@ -3905,7 +3905,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -3933,7 +3933,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -3970,7 +3970,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1578">line 1578</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1577">line 1577</a>
</li></ul></dd>
@ -4010,7 +4010,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 3 (Error)
Send a syslog message with a severity level of 3 (Error)
</div>
@ -4089,7 +4089,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -4117,7 +4117,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -4154,7 +4154,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1660">line 1660</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1659">line 1659</a>
</li></ul></dd>
@ -4194,7 +4194,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 6 (Informational)
Send a syslog message with a severity level of 6 (Informational)
</div>
@ -4273,7 +4273,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -4301,7 +4301,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -4338,7 +4338,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1647">line 1647</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1646">line 1646</a>
</li></ul></dd>
@ -4378,7 +4378,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 6 (Informational)
Send a syslog message with a severity level of 6 (Informational)
</div>
@ -4457,7 +4457,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -4485,7 +4485,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -4522,7 +4522,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1670">line 1670</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1669">line 1669</a>
</li></ul></dd>
@ -4562,7 +4562,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 6 (Informational)
Send a syslog message with a severity level of 6 (Informational)
</div>
@ -4641,7 +4641,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -4669,7 +4669,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -4706,7 +4706,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1637">line 1637</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1636">line 1636</a>
</li></ul></dd>
@ -4746,7 +4746,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 5 (Notice)
Send a syslog message with a severity level of 5 (Notice)
</div>
@ -4825,7 +4825,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -4853,7 +4853,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -4890,7 +4890,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1624">line 1624</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1623">line 1623</a>
</li></ul></dd>
@ -4930,7 +4930,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 5 (Notice)
Send a syslog message with a severity level of 5 (Notice)
</div>
@ -5009,7 +5009,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -5037,7 +5037,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -5074,7 +5074,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1492">line 1492</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1491">line 1491</a>
</li></ul></dd>
@ -5121,9 +5121,9 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
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.
</div>
@ -5177,7 +5177,7 @@ fashion where new messages are writen to the class as needed.</div>
<td class="description last">The unformated Syslog message to send</td>
<td class="description last">The unformatted Syslog message to send</td>
</tr>
@ -5230,7 +5230,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
A Syslog formated string acording to the selected RFC
A Syslog formatted string according to the selected RFC
</div>
@ -5267,7 +5267,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1201">line 1201</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1200">line 1200</a>
</li></ul></dd>
@ -5688,7 +5688,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1614">line 1614</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1613">line 1613</a>
</li></ul></dd>
@ -5728,7 +5728,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 4 (Warning)
Send a syslog message with a severity level of 4 (Warning)
</div>
@ -5807,7 +5807,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -5835,7 +5835,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -5872,7 +5872,7 @@ fashion where new messages are writen to the class as needed.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1601">line 1601</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1600">line 1600</a>
</li></ul></dd>
@ -5912,7 +5912,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="description">
Send a syslog message with a secerity level of 4 (Warning)
Send a syslog message with a severity level of 4 (Warning)
</div>
@ -5991,7 +5991,7 @@ fashion where new messages are writen to the class as needed.</div>
<dl>
<dt>
<div class="param-desc">
- Any bubbled up error
- Any bubbled-up error
</div>
</dt>
<dd></dd>
@ -6019,7 +6019,7 @@ fashion where new messages are writen to the class as needed.</div>
<div class="param-desc">
- The formated syslog message sent to the Syslog server
- The formatted syslog message sent to the Syslog server
</div>
@ -6059,7 +6059,7 @@ fashion where new messages are writen to the class as needed.</div>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Sep 25 2018 18:22:00 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Sep 25 2018 19:11:53 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>
<script>prettyPrint();</script>

View File

@ -50,11 +50,11 @@
</h2>
<div class="class-description">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. *</div>
Syslog formatting classes can be used as input into a Syslog class to be used
simultaneously to the same Syslog server. *</div>
</header>
@ -81,7 +81,7 @@ simultatniusly to the same Syslog server. *</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line106">line 106</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line107">line 107</a>
</li></ul></dd>
@ -194,7 +194,7 @@ simultatniusly to the same Syslog server. *</div>
<td class="description last">Options object
>>>Transport Configuraton
>>>Transport Configuration
<h6>Properties</h6>
@ -257,8 +257,8 @@ simultatniusly to the same Syslog server. *</div>
<td class="description last">The IP Address|FQDN of the
Syslog Server, this option if set will take prasdents over any target
set in a formating object</td>
Syslog Server, this option if set will take presidents over any target
set in a formatting object</td>
</tr>
@ -297,9 +297,9 @@ simultatniusly to the same Syslog server. *</div>
</td>
<td class="description last">L4 transport portocol
(udp|tcp|tls), this option if set will take prasdents over any transport
set in a formating object</td>
<td class="description last">L4 transport protocol
(udp|tcp|tls), this option if set will take presidents over any transport
set in a formatting object</td>
</tr>
@ -339,7 +339,7 @@ simultatniusly to the same Syslog server. *</div>
<td class="description last">IP port, this option if set will take
prasdents over any IP Port set in a formating object</td>
presidents over any IP Port set in a formatting object</td>
</tr>
@ -379,8 +379,8 @@ simultatniusly to the same Syslog server. *</div>
<td class="description last">Ignored for all other
transports, this option if set will take prasdents over any timeout
set in a formating object</td>
transports, this option if set will take presidents over any timeout
set in a formatting object</td>
</tr>
@ -417,9 +417,9 @@ simultatniusly to the same Syslog server. *</div>
</td>
<td class="description last">Array of authrized TLS server
certificates file locations, this option if set will take prasdents
over any certificates set in a formating object</td>
<td class="description last">Array of authorized TLS server
certificates file locations, this option if set will take presidents
over any certificates set in a formatting object</td>
</tr>
@ -458,7 +458,7 @@ simultatniusly to the same Syslog server. *</div>
<td class="description last">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</td>
presidents over any certificates set in a formatting object</td>
</tr>
@ -497,7 +497,7 @@ simultatniusly to the same Syslog server. *</div>
<td class="description last">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</td>
</tr>
@ -686,7 +686,7 @@ simultatniusly to the same Syslog server. *</div>
</td>
<td class="description last"><a href="module-SyslogPro-CEF.html">HP CEF (Common Event Format) formating object</a></td>
<td class="description last"><a href="module-SyslogPro-CEF.html">HP CEF (Common Event Format) formatting object</a></td>
</tr>
@ -756,7 +756,7 @@ simultatniusly to the same Syslog server. *</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line212">line 212</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line213">line 213</a>
</li></ul></dd>
@ -825,7 +825,7 @@ simultatniusly to the same Syslog server. *</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line181">line 181</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line182">line 182</a>
</li></ul></dd>
@ -894,7 +894,7 @@ simultatniusly to the same Syslog server. *</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line204">line 204</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line205">line 205</a>
</li></ul></dd>
@ -963,7 +963,7 @@ simultatniusly to the same Syslog server. *</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line159">line 159</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line160">line 160</a>
</li></ul></dd>
@ -1032,7 +1032,7 @@ simultatniusly to the same Syslog server. *</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line156">line 156</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line157">line 157</a>
</li></ul></dd>
@ -1101,7 +1101,7 @@ simultatniusly to the same Syslog server. *</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line188">line 188</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line189">line 189</a>
</li></ul></dd>
@ -1170,7 +1170,7 @@ simultatniusly to the same Syslog server. *</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line196">line 196</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line197">line 197</a>
</li></ul></dd>
@ -1239,7 +1239,7 @@ simultatniusly to the same Syslog server. *</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line154">line 154</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line155">line 155</a>
</li></ul></dd>
@ -1308,7 +1308,7 @@ simultatniusly to the same Syslog server. *</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line161">line 161</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line162">line 162</a>
</li></ul></dd>
@ -1377,7 +1377,7 @@ simultatniusly to the same Syslog server. *</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line172">line 172</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line173">line 173</a>
</li></ul></dd>
@ -1446,7 +1446,7 @@ simultatniusly to the same Syslog server. *</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line176">line 176</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line177">line 177</a>
</li></ul></dd>
@ -1515,7 +1515,7 @@ simultatniusly to the same Syslog server. *</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line168">line 168</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line169">line 169</a>
</li></ul></dd>
@ -1584,7 +1584,7 @@ simultatniusly to the same Syslog server. *</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line246">line 246</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line247">line 247</a>
</li></ul></dd>
@ -1653,7 +1653,7 @@ simultatniusly to the same Syslog server. *</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line242">line 242</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line243">line 243</a>
</li></ul></dd>
@ -1699,9 +1699,9 @@ simultatniusly to the same Syslog server. *</div>
<div class="description">
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
</div>
@ -1943,7 +1943,7 @@ selected transport.
<td class="description last">The formated Syslog Message</td>
<td class="description last">The formatted Syslog Message</td>
</tr>
@ -2023,7 +2023,7 @@ selected transport.
<div class="param-desc">
- The Syslog formated string sent
- The Syslog formatted string sent
</div>
@ -2060,7 +2060,7 @@ selected transport.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line294">line 294</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line295">line 295</a>
</li></ul></dd>
@ -2154,7 +2154,7 @@ selected transport.
<td class="description last">The formated Syslog Message</td>
<td class="description last">The formatted Syslog Message</td>
</tr>
@ -2234,7 +2234,7 @@ selected transport.
<div class="param-desc">
- The Syslog formated string sent
- The Syslog formatted string sent
</div>
@ -2271,7 +2271,7 @@ selected transport.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line340">line 340</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line341">line 341</a>
</li></ul></dd>
@ -2365,7 +2365,7 @@ selected transport.
<td class="description last">The formated Syslog Message</td>
<td class="description last">The formatted Syslog Message</td>
</tr>
@ -2445,7 +2445,7 @@ selected transport.
<div class="param-desc">
- The Syslog formated string sent
- The Syslog formatted string sent
</div>
@ -2482,7 +2482,7 @@ selected transport.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line264">line 264</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line265">line 265</a>
</li></ul></dd>
@ -2576,7 +2576,7 @@ selected transport.
<td class="description last">The formated Syslog Message</td>
<td class="description last">The formatted Syslog Message</td>
</tr>
@ -2629,7 +2629,7 @@ selected transport.
<div class="param-desc">
- The Syslog formated string sent
- The Syslog formatted string sent
</div>
@ -2669,7 +2669,7 @@ selected transport.
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Sep 25 2018 18:22:00 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Sep 25 2018 19:11:53 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>
<script>prettyPrint();</script>

View File

@ -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.</div>
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.</div>
@ -75,7 +75,7 @@ classes so that they may run independtly.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line3">line 3</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line4">line 4</a>
</li></ul></dd>
@ -207,7 +207,7 @@ classes so that they may run independtly.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line35">line 35</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line36">line 36</a>
</li></ul></dd>
@ -355,7 +355,7 @@ classes so that they may run independtly.</div>
<div class="param-desc">
- The formated ANSI color code
- The formatted ANSI color code
</div>
@ -395,7 +395,7 @@ classes so that they may run independtly.</div>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Sep 25 2018 18:22:00 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Sep 25 2018 19:11:53 GMT+0000 (Coordinated Universal Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>
<script>prettyPrint();</script>

386
index.js
View File

@ -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 <craig@kentik.com>
* @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
*/
@ -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';
@ -779,12 +779,11 @@ 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')
@ -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,35 +1008,35 @@ 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 time zone
* @param {boolean} [options.encludeStructuredData=false] - Included
@ -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@<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) {
@ -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;
}
@ -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) => {
@ -2360,3 +2359,4 @@ module.exports = {
CEF: CEF,
Syslog: Syslog
};

View File

@ -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();