Return to
Portfolio

109.33. 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.

Note
It is recommended to disable FlowControl when this module is used 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 block in any programs trying to write to the system log and an unresponsive system may result.

For parsing Syslog messages, see the pm_transformer module or the parse_syslog_bsd() procedure of xm_syslog.

109.33.1. Configuration

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

UDS

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

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.

UDSType

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


InputType

See the InputType directive in the list of common module directives. This defaults to dgram if UDSType is set to dgram or to linebased if UDSType is set to stream.

UDSGroup

Use this directive to set the group ownership for the created socket. By default, this is the group NXLog is running as, (which may be specified by the global Group directive).

UDSOwner

Use this directive to set the user ownership for the created socket. By default, this is the user NXLog is running as (which may be specified by the global User directive).

UDSPerms

This directive specifies the permissions to use for the created socket. This must be a four-digit octal value beginning with a zero. By default, universal read/write permissions will be set (octal value 0666).

109.33.2. Examples

Example 571. Using the im_uds Module

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

nxlog.conf [Download file]
1
2
3
4
5
<Input uds>
    Module      im_uds
    UDS         /dev/log
    FlowControl False
</Input>
Example 572. Setting Socket Ownership With im_uds

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

nxlog.conf [Download file]
1
2
3
4
5
6
7
<Input uds>
    Module  im_uds
    UDS         /opt/nxlog/var/spool/nxlog/socket
    UDSOwner    root
    UDSGroup    adm
    UDSPerms    0660
</Input>