Add Syslog Server

Register a Syslog server with the library to receive Syslog notifications.

The Syslog server is uniquely identified by the server address, which can be either an IPv4 address or a DNS hostname. DNS hostname support allows you to configure Syslog servers using fully qualified domain names (FQDNs), which is useful in environments where IP addresses may change or when using centralized logging infrastructure. The default port for Syslog servers is 514. Events sent to Syslog servers can be filtered at the library level by severity level (error, warning, and/or information).

The maximum number of configured Syslog servers is five.

Request syntax

Request body parameters

address (string, required)

IPv4 address or DNS hostname of the Syslog server. DNS hostnames must be resolvable by the library's configured DNS servers. Examples: 192.168.0.13 or syslog.example.com

port (number, optional)

Port number of the syslog server. The default is 514.

subscribed (array of strings)

A list of event severities that specify which events will be sent to this Syslog server. This list includes the following possible strings: “error”, “warning”, or “information”

Examples

Example using an IPv4 address:

> POST /v1/notification/syslog/servers {"address": "192.168.0.13"}
HTTP/1.1 201 Created
Location: /v1/notification/syslog/servers/192.168.0.13
Content-Type: application/json
Content-Length: 10

Example using a DNS hostname:

> POST /v1/notification/syslog/servers {"address": "syslog.example.com", "port": 514, "subscribed": ["error", "warning"]}
HTTP/1.1 201 Created
Location: /v1/notification/syslog/servers/syslog.example.com
Content-Type: application/json
Content-Length: 10

Error handling

  • Returns 422 Unprocessable Entry if five Syslog servers are already configured when this is called.