111.22. 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 can use this module to send log messages to another Syslog daemon via the socket.
Note
|
This module supports SOCK_DGRAM type sockets only. SOCK_STREAM type sockets may be supported in the future. |
111.22.1. Configuration
The om_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
.
- UDSType
-
This directive specifies the domain socket type. Supported values are
dgram
,stream
, andauto
. The default isauto
.
- OutputType
-
See the OutputType directive in the list of common module directives. If UDSType is set to
Dgram
or is set toauto
and a SOCK_DGRAM type socket is detected, this defaults toDgram
. If UDSType is set tostream
or is set toauto
and a SOCK_STREAM type socket is detected, this defaults toLineBased
.
111.22.2. Examples
This configuration reads log messages from a file, adds BSD Syslog headers with default fields, and writes the messages to socket.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<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>