Unix Domain Sockets (im_uds)

This module allows log messages to be received over a Unix domain socket. Unix systems traditionally have a /dev/log or similar socket used by the system logger to accept messages. Applications use the syslog(3) system call to send messages to the system logger.

To examine the supported platforms, see the list of installation packages.
We recommend disabling FlowControl when using this module to collect local syslog messages from the /dev/log Unix domain socket. Otherwise, if the corresponding output queue becomes full, the syslog() system call will be blocked and programs trying to write to the system log may become unresponsive.

See the parse_syslog_bsd() procedure of the xm_syslog module for more information on parsing syslog messages.

Configuration

The im_uds module accepts the following directives in addition to the common module directives.

File permissions

The following directives are for specifying permissions for the created socket, pipe, or, file.

Group

Set this directive to specify the group who owns the created socket, pipe, or file.

The default is the group set by the global Group directive. This directive does not work on Windows.

Perms

Set this directive to specify the permissions for the created socket, pipe, or file. Enter the value as a four-digit octal number starting with zero.

The default is the operating system’s default permissions. This directive does not work on Windows.

If the path includes non-existent directories, NXLog Agent adds execute permission (allowing directory browsing) to each newly created directory along the path for the current user.

User

Set this directive to specify the user who owns the created socket, pipe, or file.

The default is the user set by the global User directive. This directive does not work on Windows.

Optional directives

CreateDir

If set to TRUE, this optional boolean directive instructs the module to create the directory where the UDS socket file is located, if it does not already exist. The default is FALSE.

InputType

This directive is identical to the InputType common module directive.

The default is Dgram if UDSType is set to dgram, or LineBased if it is set to stream.

UDS

This specifies the path of the Unix domain socket. The default is /dev/log.

UDSType

This directive specifies the domain socket type. Supported values are dgram and stream. The default is dgram.

Examples

Example 1. Using the im_uds module

This configuration will accept logs via the specified socket and write them to a file.

nxlog.conf
<Input uds>
    Module      im_uds
    UDS         /dev/log
    FlowControl False
</Input>
Example 2. Setting socket ownership with im_uds

This configuration accepts logs via the specified socket. It also specifies the ownership and permissions to use for the socket.

nxlog.conf
<Input uds>
    Module  im_uds
    UDS         /opt/nxlog/var/spool/nxlog/socket
    UDSOwner    root
    UDSGroup    adm
    UDSPerms    0660
</Input>