Skip to content

Latest commit

 

History

History
1258 lines (935 loc) · 60 KB

api.md

File metadata and controls

1258 lines (935 loc) · 60 KB

API

API convention

SyslogPro

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 [email protected]
Copyright: (c) 2018 - Craig Yamato

SyslogPro~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

new Syslog([options])

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

syslog.target : string

Kind: instance property of Syslog

syslog.protocol : string

Kind: instance property of Syslog

syslog.port : number

Kind: instance property of Syslog

syslog.tcpTimeout : number

Kind: instance property of Syslog

syslog.tlsServerCerts : Array.<string>

Kind: instance property of Syslog

syslog.tlsClientCert : string

Kind: instance property of Syslog

syslog.tlsClientKey : string

Kind: instance property of Syslog

syslog.format : string

Kind: instance property of Syslog

syslog.rfc3164 : RFC3164

Kind: instance property of Syslog

syslog.rfc5424 : RFC5424

Kind: instance property of Syslog

syslog.leef : LEEF

Kind: instance property of Syslog

syslog.cef : CEF

Kind: instance property of Syslog

SyslogPro~RFC3164

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

new RFC3164([options])

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

rfC3164.color : boolean

Kind: instance property of RFC3164

rfC3164.extendedColor : boolean

Kind: instance property of RFC3164

rfC3164.setColor()

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)

rfC3164.buildMessage(msg, [options]) ⇒ Promise

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

rfC3164.send(msg, [options]) ⇒ Promise

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

rfC3164.emergency(msg) ⇒ Promise

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

rfC3164.emer(msg) ⇒ Promise

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

rfC3164.alert(msg) ⇒ Promise

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

rfC3164.critical(msg) ⇒ Promise

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

rfC3164.crit(msg) ⇒ Promise

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

rfC3164.error(msg) ⇒ Promise

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

rfC3164.err(msg) ⇒ Promise

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

rfC3164.warning(msg) ⇒ Promise

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

rfC3164.warn(msg) ⇒ Promise

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

rfC3164.notice(msg) ⇒ Promise

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

rfC3164.note(msg) ⇒ Promise

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

rfC3164.informational(msg) ⇒ Promise

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

rfC3164.info(msg) ⇒ Promise

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

rfC3164.log(msg) ⇒ Promise

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

rfC3164.debug(msg) ⇒ Promise

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

SyslogPro~RFC5424

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

new RFC5424([options])

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

rfC5424.timestamp : boolean

Kind: instance property of RFC5424

rfC5424.timestampUTC : boolean

Kind: instance property of RFC5424

rfC5424.timestampTZ : boolean

Kind: instance property of RFC5424

rfC5424.timestampMS : boolean

Kind: instance property of RFC5424

rfC5424.includeStructuredData : boolean

Kind: instance property of RFC5424

rfC5424.utf8BOM : boolean

Kind: instance property of RFC5424

rfC5424.color : boolean

Kind: instance property of RFC5424

rfC5424.extendedColor : boolean

Kind: instance property of RFC5424

rfC5424.setColor()

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)

rfC5424.buildMessage(msg, [options]) ⇒ Promise

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

rfC5424.send(msg) ⇒ Promise

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

rfC5424.emergency(msg) ⇒ Promise

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

rfC5424.emer(msg) ⇒ Promise

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

rfC5424.alert(msg) ⇒ Promise

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

rfC5424.critical(msg) ⇒ Promise

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

rfC5424.crit(msg) ⇒ Promise

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

rfC5424.error(msg) ⇒ Promise

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

rfC5424.err(msg) ⇒ Promise

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

rfC5424.warning(msg) ⇒ Promise

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

rfC5424.warn(msg) ⇒ Promise

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

rfC5424.notice(msg) ⇒ Promise

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

rfC5424.note(msg) ⇒ Promise

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

rfC5424.informational(msg) ⇒ Promise

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

rfC5424.info(msg) ⇒ Promise

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

rfC5424.log(msg) ⇒ Promise

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

rfC5424.debug(msg) ⇒ Promise

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

SyslogPro~LEEF

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

new LEEF([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

leeF.vendor : string

Kind: instance property of LEEF

leeF.product : string

Kind: instance property of LEEF

leeF.version : string

Kind: instance property of LEEF

leeF.eventId : string

Kind: instance property of LEEF

leeF.syslogHeader : boolean

Kind: instance property of LEEF

leeF.attributes : object

Kind: instance property of LEEF

leeF.buildMessage() ⇒ Promise

Build a formatted message

Kind: instance method of LEEF
Returns: Promise - - string with formatted message
Access: public

leeF.send([options])

Kind: instance method of LEEF
Access: public

Param Type Default Description
[options] Syslog false A {@link module:SyslogPro~Syslog

SyslogPro~CEF

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

new CEF([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

ceF.deviceVendor : string

Kind: instance property of CEF

ceF.deviceProduct : string

Kind: instance property of CEF

ceF.deviceVersion : string

Kind: instance property of CEF

ceF.deviceEventClassId : string

Kind: instance property of CEF

ceF.name : string

Kind: instance property of CEF

ceF.severity : string

Kind: instance property of CEF

ceF.extensions : object

Kind: instance property of CEF

ceF.validate() ⇒ Promise

Validate this CEF object

Kind: instance method of CEF
Returns: Promise - - True if validated
Throws:

  • Error - First element to fail validation

Access: public

ceF.buildMessage() ⇒ Promise

Build a CEF formated string

Kind: instance method of CEF
Returns: Promise - - String with formated message
Access: public

ceF.send([options])

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)

Test

  npm test

Contributing

Please try to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.