- back to README.md
The SyslogPro module for sending syslog messages
Most APIs will return a promise. These APIs can be used using
then(...)/catch(...)
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
Copyright: (c) 2018 - Craig Yamato
- SyslogPro
- ~Syslog
- new Syslog([options])
- .target :
string
- .protocol :
string
- .port :
number
- .tcpTimeout :
number
- .tlsServerCerts :
Array.<string>
- .tlsClientCert :
string
- .tlsClientKey :
string
- .format :
string
- .rfc3164 :
RFC3164
- .rfc5424 :
RFC5424
- .leef :
LEEF
- .cef :
CEF
- ~RFC3164
- new RFC3164([options])
- .color :
boolean
- .extendedColor :
boolean
- .setColor()
- .buildMessage(msg, [options]) ⇒
Promise
- .send(msg, [options]) ⇒
Promise
- .emergency(msg) ⇒
Promise
- .emer(msg) ⇒
Promise
- .alert(msg) ⇒
Promise
- .critical(msg) ⇒
Promise
- .crit(msg) ⇒
Promise
- .error(msg) ⇒
Promise
- .err(msg) ⇒
Promise
- .warning(msg) ⇒
Promise
- .warn(msg) ⇒
Promise
- .notice(msg) ⇒
Promise
- .note(msg) ⇒
Promise
- .informational(msg) ⇒
Promise
- .info(msg) ⇒
Promise
- .log(msg) ⇒
Promise
- .debug(msg) ⇒
Promise
- ~RFC5424
- new RFC5424([options])
- .timestamp :
boolean
- .timestampUTC :
boolean
- .timestampTZ :
boolean
- .timestampMS :
boolean
- .includeStructuredData :
boolean
- .utf8BOM :
boolean
- .color :
boolean
- .extendedColor :
boolean
- .setColor()
- .buildMessage(msg, [options]) ⇒
Promise
- .send(msg) ⇒
Promise
- .emergency(msg) ⇒
Promise
- .emer(msg) ⇒
Promise
- .alert(msg) ⇒
Promise
- .critical(msg) ⇒
Promise
- .crit(msg) ⇒
Promise
- .error(msg) ⇒
Promise
- .err(msg) ⇒
Promise
- .warning(msg) ⇒
Promise
- .warn(msg) ⇒
Promise
- .notice(msg) ⇒
Promise
- .note(msg) ⇒
Promise
- .informational(msg) ⇒
Promise
- .info(msg) ⇒
Promise
- .log(msg) ⇒
Promise
- .debug(msg) ⇒
Promise
- ~LEEF
- new LEEF([options])
- .vendor :
string
- .product :
string
- .version :
string
- .eventId :
string
- .syslogHeader :
boolean
- .attributes :
object
- .buildMessage() ⇒
Promise
- .send([options])
- ~CEF
- new CEF([options])
- .deviceVendor :
string
- .deviceProduct :
string
- .deviceVersion :
string
- .deviceEventClassId :
string
- .name :
string
- .severity :
string
- .extensions :
object
- .validate() ⇒
Promise
- .buildMessage() ⇒
Promise
- .send([options])
- ~Syslog
A class to work with syslog messages using UDP, TCP, or TLS transport. 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 formatting classes can be used as input into a Syslog class to be used simultaneously to the same Syslog server. *
Kind: inner class of SyslogPro
Requires: module:moment
Since: 0.0.0
Version: 0.0.0
- ~Syslog
- new Syslog([options])
- .target :
string
- .protocol :
string
- .port :
number
- .tcpTimeout :
number
- .tlsServerCerts :
Array.<string>
- .tlsClientCert :
string
- .tlsClientKey :
string
- .format :
string
- .rfc3164 :
RFC3164
- .rfc5424 :
RFC5424
- .leef :
LEEF
- .cef :
CEF
Construct a new Syslog transport object with user options
Param | Type | Default | Description |
---|---|---|---|
[options] | object |
Options object >>>Transport Configuration | |
[options.target] | string |
"'localhost'" |
The IP Address |
[options.protocol] | string |
"'udp'" |
L4 transport protocol (udp |
[options.port] | number |
514 |
IP port, this option if set will take presidents over any IP Port set in a formatting object |
[options.tcpTimeout] | number |
10000 |
Ignored for all other transports, this option if set will take presidents over any timeout set in a formatting object |
[options.tlsServerCerts] | Array.<string> |
Array of authorized TLS server certificates file locations, this option if set will take presidents over any certificates set in a formatting object | |
[options.tlsClientCert] | string |
Client TLS certificate file location that this client should use, this option if set will take presidents over any certificates set in a formatting object | |
[options.tlsClientKey] | string |
Client TLS key file location that this client should use, this option if set will take presidents over any certificates set in a formatting object >>>Syslog Format Settings | |
[options.format] | string |
"'none'" |
Valid syslog format options for this module are 'none', 'rfc3164', 'rfc5424', 'leef', 'cef' |
[options.rfc5424] | RFC3164 |
{@link module:SyslogPro~RFC5424 | |
[options.rfc5424] | RFC5424 |
{@link module:SyslogPro~RFC5424 | |
[options.leef] | LEEF |
{@link module:SyslogPro~LEEF | |
[options.cef] | CEF |
{@link module:SyslogPro~CEF |
Kind: instance property of Syslog
Kind: instance property of Syslog
Kind: instance property of Syslog
Kind: instance property of Syslog
Kind: instance property of Syslog
Kind: instance property of Syslog
Kind: instance property of Syslog
Kind: instance property of Syslog
Kind: instance property of Syslog
Kind: instance property of Syslog
Kind: instance property of Syslog
Kind: instance property of Syslog
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 formatting classes so that it may run independently.
The RFC3164 Syslog logging format is meant to be used as a stream of log data from a service or application. This class is designed to be used in this fashion where new messages are written to the class as needed.
Kind: inner class of SyslogPro
Requires: module:moment
Since: 0.0.0
Version: 0.0.0
- ~RFC3164
- new RFC3164([options])
- .color :
boolean
- .extendedColor :
boolean
- .setColor()
- .buildMessage(msg, [options]) ⇒
Promise
- .send(msg, [options]) ⇒
Promise
- .emergency(msg) ⇒
Promise
- .emer(msg) ⇒
Promise
- .alert(msg) ⇒
Promise
- .critical(msg) ⇒
Promise
- .crit(msg) ⇒
Promise
- .error(msg) ⇒
Promise
- .err(msg) ⇒
Promise
- .warning(msg) ⇒
Promise
- .warn(msg) ⇒
Promise
- .notice(msg) ⇒
Promise
- .note(msg) ⇒
Promise
- .informational(msg) ⇒
Promise
- .info(msg) ⇒
Promise
- .log(msg) ⇒
Promise
- .debug(msg) ⇒
Promise
Construct a new RFC3164 formatted Syslog object with user options
Param | Type | Default | Description |
---|---|---|---|
[options] | object |
Options object | |
[options.applicationName] | string |
"'NodeJSLogger'" |
Application |
[options.hostname] | string |
"os.hostname" |
The name of this server |
[options.facility] | number |
23 |
Facility code to use sending this message |
[options.color] | boolean |
false |
Apply color coding encoding tag with syslog message text |
[options.extendedColor] | boolean |
false |
Use the extended ANSI color set encoding tag with syslog message text |
[options.colors] | object |
User defended colors for severities | |
[options.colors.emergencyColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | |
[options.colors.alertColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | |
[options.colors.criticalColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | |
[options.colors.errorColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | |
[options.colors.warningColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | |
[options.colors.noticeColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | |
[options.colors.informationalColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | |
[options.colors.debugColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | |
[options.server] | Syslog |
false |
A {@link module:SyslogPro~Syslog |
Kind: instance property of RFC3164
Kind: instance property of RFC3164
Sets the color to be used for messages at a set priority
Kind: instance method of RFC3164
Throws:
Error
A standard error object
Access: public
Param | Type | Description |
---|---|---|
[colors.emergencyColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
[colors.alertColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
[colors.criticalColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
[colors.errorColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
[colors.warningColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
[colors.noticeColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
[colors.informationalColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
[colors.debugColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
Building a formatted message. Returns a promise with a formatted message
Kind: instance method of RFC3164
Returns: Promise
- A Syslog formatted string according to the selected RFC
Throws:
Error
A standard error object
Access: public
Param | Type | Default | Description |
---|---|---|---|
msg | string |
The Syslog Message | |
[options] | object |
Options object | |
[options.severity] | number |
7 |
An array of structure |
[options.colorCode] | number |
36 |
The ANSI color code to use if message coloration is selected |
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 default Syslog connector will be used.
Kind: instance method of RFC3164
Returns: Promise
- A Syslog formatted string according to the selected RFC
Throws:
Error
A standard error object
Access: public
See: SyslogPro~Syslog
Param | Type | Default | Description |
---|---|---|---|
msg | string |
The unformatted Syslog message to send | |
[options] | object |
Options object | |
[options.severity] | number |
7 |
An array of structure |
[options.colorCode] | number |
36 |
The ANSI color code to use if |
Send a syslog message with a security level of 0 (Emergency)
Kind: instance method of RFC3164
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The emergency message to send to the Syslog server |
Send a syslog message with a security level of 0 (Emergency)
Kind: instance method of RFC3164
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The emergency message to send to the Syslog server |
Send a syslog message with a severity level of 1 (Alert)
Kind: instance method of RFC3164
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The alert message to send to the Syslog server |
Send a syslog message with a severity level of 2 (Critical)
Kind: instance method of RFC3164
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The critical message to send to the Syslog server |
Send a syslog message with a severity level of 2 (Critical)
Kind: instance method of RFC3164
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The critical message to send to the Syslog server |
Send a syslog message with a severity level of 3 (Error)
Kind: instance method of RFC3164
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The error message to send to the Syslog server |
Send a syslog message with a severity level of 3 (Error)
Kind: instance method of RFC3164
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The error message to send to the Syslog server |
Send a syslog message with a severity level of 4 (Warning)
Kind: instance method of RFC3164
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The warning message to send to the Syslog server |
Send a syslog message with a severity level of 4 (Warning)
Kind: instance method of RFC3164
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The warning message to send to the Syslog server |
Send a syslog message with a severity level of 5 (Notice)
Kind: instance method of RFC3164
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The notice message to send to the Syslog server |
Send a syslog message with a severity level of 5 (Notice)
Kind: instance method of RFC3164
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The notice message to send to the Syslog server |
Send a syslog message with a severity level of 6 (Informational)
Kind: instance method of RFC3164
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The informational message to send to the Syslog server |
Send a syslog message with a severity level of 6 (Informational)
Kind: instance method of RFC3164
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The informational message to send to the Syslog server |
Send a syslog message with a severity level of 6 (Informational)
Kind: instance method of RFC3164
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The informational message to send to the Syslog server |
Send a syslog message with a severity level of 7 (Debug)
Kind: instance method of RFC3164
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The debug message to send to the Syslog server |
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 formatting classes so that it may run independently.
The RFC5424 Syslog logging format is meant to be used as a stream of log data from a service or application. This class is designed to be used in this fashion where new messages are written to the class as needed.
Kind: inner class of SyslogPro
Requires: module:moment
Since: 0.0.0
Version: 0.0.0
- ~RFC5424
- new RFC5424([options])
- .timestamp :
boolean
- .timestampUTC :
boolean
- .timestampTZ :
boolean
- .timestampMS :
boolean
- .includeStructuredData :
boolean
- .utf8BOM :
boolean
- .color :
boolean
- .extendedColor :
boolean
- .setColor()
- .buildMessage(msg, [options]) ⇒
Promise
- .send(msg) ⇒
Promise
- .emergency(msg) ⇒
Promise
- .emer(msg) ⇒
Promise
- .alert(msg) ⇒
Promise
- .critical(msg) ⇒
Promise
- .crit(msg) ⇒
Promise
- .error(msg) ⇒
Promise
- .err(msg) ⇒
Promise
- .warning(msg) ⇒
Promise
- .warn(msg) ⇒
Promise
- .notice(msg) ⇒
Promise
- .note(msg) ⇒
Promise
- .informational(msg) ⇒
Promise
- .info(msg) ⇒
Promise
- .log(msg) ⇒
Promise
- .debug(msg) ⇒
Promise
Construct a new RFC5424 formatted Syslog object with user options
Param | Type | Default | Description |
---|---|---|---|
[options] | object |
Options object | |
[options.applicationName] | string |
"'NodeJSLogger'" |
Application |
[options.hostname] | string |
"os.hostname" |
The name of this server |
[options.timestamp] | boolean |
false |
Included a Timestamp |
[options.timestampUTC] | boolean |
false |
RFC standard is for local time |
[options.timestampMS] | boolean |
false |
Timestamp with ms resolution |
[options.timestampTZ] | boolean |
true |
Should the timestamp included time zone |
[options.includeStructuredData] | boolean |
false |
Included any provided structured data |
[options.utf8BOM] | boolean |
true |
Included the UTF8 |
[options.color] | boolean |
false |
Included the UTF8 |
[options.extendedColor] | boolean |
false |
Included the UTF8 encoding tag with syslog message text |
[options.colors] | object |
User defended colors for severities | |
[options.colors.emergencyColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | |
[options.colors.alertColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | |
[options.colors.criticalColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | |
[options.colors.errorColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | |
[options.colors.warningColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | |
[options.colors.noticeColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | |
[options.colors.informationalColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | |
[options.colors.debugColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) | |
[options.server] | Syslog |
false |
A {@link module:SyslogPro~Syslog |
Kind: instance property of RFC5424
Kind: instance property of RFC5424
Kind: instance property of RFC5424
Kind: instance property of RFC5424
Kind: instance property of RFC5424
Kind: instance property of RFC5424
Kind: instance property of RFC5424
Kind: instance property of RFC5424
Sets the color to be used for messages at a set priority
Kind: instance method of RFC5424
Throws:
Error
A standard error object
Access: public
Param | Type | Description |
---|---|---|
[colors.emergencyColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
[colors.alertColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
[colors.criticalColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
[colors.errorColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
[colors.warningColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
[colors.noticeColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
[colors.informationalColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
[colors.debugColor] | string |
A RGB Hex coded color in the form of #FFFFFF or as or the ANSI color code number (30-37 Standard & 0-255 Extended) |
Building a formatted message. Returns a promise with a formatted message
Kind: instance method of RFC5424
Returns: Promise
- A Syslog formatted string according to the selected RFC
Throws:
Error
A standard error object
Access: public
Param | Type | Default | Description |
---|---|---|---|
msg | string |
The Syslog Message | |
[options] | object |
Options object | |
[options.severity] | number |
7 |
An array of structure |
[options.facility] | number |
23 |
Facility code to use sending this message |
[options.pid] | string |
"'-'" |
The process id of the service sending this message |
[options.structuredData] | Array.<string> |
An array of structure data strings conforming to the IETF/IANA defined SD-IDs or IANA registered SMI Network Management Private Enterprise Code SD-ID conforming to the format [name@ parameter=value] | |
[options.colorCode] | number |
36 |
The ANSI color code to use if message coloration is selected |
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 default Syslog connector will be used.
Kind: instance method of RFC5424
Returns: Promise
- A Syslog formatted string according to the selected RFC
Throws:
Error
A standard error object
Access: public
See: SyslogPro~Syslog
Param | Type | Description |
---|---|---|
msg | string |
The unformatted Syslog message to send |
Send a syslog message with a severity level of 0 (Emergency)
Kind: instance method of RFC5424
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The emergency message to send to the Syslog server |
Send a syslog message with a severity level of 0 (Emergency)
Kind: instance method of RFC5424
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The emergency message to send to the Syslog server |
Send a syslog message with a severity level of 1 (Alert)
Kind: instance method of RFC5424
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The alert message to send to the Syslog server |
Send a syslog message with a severity level of 2 (Critical)
Kind: instance method of RFC5424
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The critical message to send to the Syslog server |
Send a syslog message with a severity level of 2 (Critical)
Kind: instance method of RFC5424
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The critical message to send to the Syslog server |
Send a syslog message with a severity level of 3 (Error)
Kind: instance method of RFC5424
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The error message to send to the Syslog server |
Send a syslog message with a severity level of 3 (Error)
Kind: instance method of RFC5424
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The error message to send to the Syslog server |
Send a syslog message with a severity level of 4 (Warning)
Kind: instance method of RFC5424
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The warning message to send to the Syslog server |
Send a syslog message with a severity level of 4 (Warning)
Kind: instance method of RFC5424
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The warning message to send to the Syslog server |
Send a syslog message with a severity level of 5 (Notice)
Kind: instance method of RFC5424
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The notice message to send to the Syslog server |
Send a syslog message with a severity level of 5 (Notice)
Kind: instance method of RFC5424
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The notice message to send to the Syslog server |
Send a syslog message with a severity level of 6 (Informational)
Kind: instance method of RFC5424
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The informational message to send to the Syslog server |
Send a syslog message with a severity level of 6 (Informational)
Kind: instance method of RFC5424
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The informational message to send to the Syslog server |
Send a syslog message with a severity level of 6 (Informational)
Kind: instance method of RFC5424
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The informational message to send to the Syslog server |
Send a syslog message with a severity level of 7 (Debug)
Kind: instance method of RFC5424
Returns: Promise
- - The formatted syslog message sent to the Syslog server
Throws:
Error
- Any bubbled-up error
Access: public
Param | Type | Description |
---|---|---|
msg | string |
The debug message to send to the Syslog server |
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
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 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 meant to be used once per message.
Kind: inner class of SyslogPro
Requires: module:moment
Since: 0.0.0
Version: 0.0.0
- ~LEEF
- new LEEF([options])
- .vendor :
string
- .product :
string
- .version :
string
- .eventId :
string
- .syslogHeader :
boolean
- .attributes :
object
- .buildMessage() ⇒
Promise
- .send([options])
Construct a new LEEF formatting object with user options
Param | Type | Default | Description |
---|---|---|---|
[options] | object |
Options object | |
[options.vendor] | string |
"'unknown'" |
The vendor of the system that generated the event being reported |
[options.product] | string |
"'unknown'" |
The product name of the system that genrated the event being reported |
[options.version] | string |
"'unknown'" |
The version name of the system that genrated the event being reported |
[options.eventId] | string |
"'unknown'" |
The eventId of the system that genrated the event being reported |
[options.attributes] | object |
LEEF message attributes which defaults to all base attributes with null values, new attributes should be added as new elements to this object | |
[options.syslogHeader] | boolean |
'true' |
Should the LEEF message include a Syslog header with Timestamp and source |
[options.server] | Syslog |
false |
A {@link module:SyslogPro~Syslog |
Kind: instance property of LEEF
Kind: instance property of LEEF
Kind: instance property of LEEF
Kind: instance property of LEEF
Kind: instance property of LEEF
Kind: instance property of LEEF
Build a formatted message
Kind: instance method of LEEF
Returns: Promise
- - string with formatted message
Access: public
Kind: instance method of LEEF
Access: public
Param | Type | Default | Description |
---|---|---|---|
[options] | Syslog |
false |
A {@link module:SyslogPro~Syslog |
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
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 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 meant to be used once per message.
Kind: inner class of SyslogPro
Requires: module:moment
Since: 0.0.0
Version: 0.0.0
- ~CEF
- new CEF([options])
- .deviceVendor :
string
- .deviceProduct :
string
- .deviceVersion :
string
- .deviceEventClassId :
string
- .name :
string
- .severity :
string
- .extensions :
object
- .validate() ⇒
Promise
- .buildMessage() ⇒
Promise
- .send([options])
Construct a new CEF formatting object with user options
Param | Type | Default | Description |
---|---|---|---|
[options] | object |
Options object | |
[options.deviceVendor] | string |
"'unknown'" |
The vendor of the system that generated the event being reported |
[options.deviceProduct] | string |
"'unknown'" |
The product name of the system that genrated the event being reported |
[options.deviceVersion] | string |
"'unknown'" |
The version name of the system that genrated the event being reported |
[options.deviceEventClassId] | string |
"'unknown'" |
The eventId of the system that genrated the event being reported |
[options.name] | string |
"'unknown'" |
Name of the service generating the notice |
[options.severity] | string |
"'unknown'" |
Severity of the notification |
[options.extensions] | string |
"{}" |
Any CEF Key=Value extensions |
[options.server] | Syslog |
false |
A {@link module:SyslogPro~Syslog |
Kind: instance property of CEF
Kind: instance property of CEF
Kind: instance property of CEF
Kind: instance property of CEF
Kind: instance property of CEF
Kind: instance property of CEF
Kind: instance property of CEF
Validate this CEF object
Kind: instance method of CEF
Returns: Promise
- - True if validated
Throws:
Error
- First element to fail validation
Build a CEF formated string
Kind: instance method of CEF
Returns: Promise
- - String with formated message
Access: public
Kind: instance method of CEF
Access: public
Param | Type | Default | Description |
---|---|---|---|
[options] | Syslog |
false |
A {@link module:SyslogPro~Syslog |
docs autogenerated via [jsdoc2md] (https://github.com/jsdoc2md/jsdoc-to-markdown)
npm test
Please try to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.