The following Admin Guide describes how enable Remote Syslog and explains its basic configuration.

Created: March 2018

Permalink: https://wildix.atlassian.net/wiki/x/SBvOAQ


Background

Rsyslog is the system for log processing. It can deliver over one million messages per second to local destinations when limited processing is applied. Rsyslog can be able to accept inputs from a wide variety of sources, transform them, and output to the results to diverse destinations.

Configuration

To enable remote syslog, go to WMS Settings -> System -> Remote syslog and check the box "Enabled".


[UDP as a Server Transport]

It is highly recommended to select UDP as a Server Transport in most of the cases.

TCP should be selected only in case the Server is reliable and constantly reachable. Otherwise, TCP packets overfill the network buffer that results in PBX unavailability.


Main rsyslog configuration file is located in /etc/rsyslog.confbut it should not be used for manual configuration.

Remote logging settings are stored in SQLite Database /var/www/wmsdb, in system table. Based on this settings, remote logging configuration file /rw2/etc/rsyslog.d/remote-server.conf is created.

Every time when remote syslog feature is enabled/ disabled, remote syslog daemon is restarted. When the feature is disabled, remote-server.conf is removed from Directory.

Directory /rw2/etc/rsyslogd/ is a symlink for /etc/rsyslog.d/.

Messages filter

Syslog messages can be filtered based on two conditions: facility and priority separated by a dot. You can create your own filters or use the default ones (see below):

In addition to the keywords specified above, you may also use an asterisk (*) to define all facilities or priorities (depending on where you place the asterisk, before or after the comma). Specifying the priority keyword 'none' serves for facilities with no given priorities. Both facility and priority conditions are case-insensitive.
To define multiple facilities and priorities, separate them with a comma (,). To define multiple selectors on one line, separate them with a semi-colon (;). Note that each selector in the selector field is capable of overwriting the preceding ones, which can exclude some priorities from the pattern.


Default filters

Select which type of messages will be sent to rsyslog:

Messages format

Messages format is specified with the help of templates. Templates allow to specify any format a user might want. They are also used for dynamic file name generation. Every output in rsyslog uses templates - this holds true for files, user messages and so on. 

Templates are a key feature of rsyslog. The database writer process expects its template to be a proper SQL statement - so this is highly customizable too.

Template example

Standard Template for writing to files:

template(name="FileFormat" type="list") {
    property(name="timestamp" dateFormat="rfc3339")
    constant(value=" ")
    property(name="hostname")
    constant(value=" ")
    property(name="syslogtag")
    property(name="msg" spifno1stsp="on" )
    property(name="msg" droplastlf="on" )
    constant(value="\n")
    }


Template names beginning with “RSYSLOG_” are reserved for rsyslog use: Select one of the messages format:

Server transport and Server destination

Choose one of the transport protocols to deliver messages to rsyslog based on your network configuration:

Enter the IP address of remote server and port where all the messages will be sent.

Appendix 1. How to debug rsyslog traffic

In this Appendix you can find tips on how to debug received rsyslog traffic.

In Linux operating system, you can use Netcat utility for listening to specified ports.


nc -l <port number>


nc -ul <port number>


Then server transport & destination with IP address and port should be configured in remote syslog settings.