Unix Domain Sockets (om_uds)

This module allows log messages to be sent to 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. NXLog Agent can use this module to send log messages to another Syslog daemon via the socket.

Configuration

The om_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

Use this directive to set the group ownership for the created socket, pipe, or file. By default, this is the group NXLog Agent is running as, (which may be specified by the global Group directive). This directive is not currently supported on Windows.

Perms

This directive specifies the permissions to use for the created socket or pipe or file. This must be a four-digit octal value beginning with a zero. By default, OS default permissions will be set. This directive is not currently supported on Windows.

User

Use this directive to set the user ownership for the created socket, pipe, or file. By default, this is the user NXLog Agent is running as (which may be specified by the global User directive). This directive is not currently supported on Windows.

Optional directives

OutputType

See the OutputType directive in the list of common module directives. If UDSType is set to Dgram or is set to auto and a SOCK_DGRAM type socket is detected, this defaults to Dgram. If UDSType is set to stream or is set to auto and a SOCK_STREAM type socket is detected, this defaults to LineBased.

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, stream, and auto. The default is auto.

Examples

Example 1. Using the om_uds Module

This configuration reads log messages from a file, adds BSD Syslog headers with default fields, and writes the messages to socket.

nxlog.conf
<Extension syslog>
    Module  xm_syslog
</Extension>

<Input file>
    Module  im_file
    File    "/var/log/custom_app.log"
</Input>

<Output uds>
    Module  om_uds
    # Defaulting Syslog fields and creating Syslog output
    Exec    parse_syslog_bsd(); to_syslog_bsd();
    UDS     /dev/log
</Output>

<Route file_to_uds>
    Path    file => uds
</Route>