# omuxsock: Unix sockets Output Module

Module Name: | omuxsock
Author: | Rainer Gerhards <rgerhards@adiscon.com>
Available since: | 4.7.3, 5.5.7

## Purpose

This module supports sending syslog messages to local Unix sockets. Thus it provided a fast message-passing interface between different rsyslog instances. The counterpart to omuxsock is imuxsock. Note that the template used together with omuxsock must be suitable to be processed by the receiver.

## Configuration Parameters

Note

Parameter names are case-insensitive.

### `obsolete legacy` directives

- $OMUxSockSocket Name of the socket to send data to. This has no default and must be set, ideally via the socketName parameter (module or action), and not via this legacy parameter.

- $OMUxSockDefaultTemplate This can be used to override the default template to be used together with omuxsock. This is primarily useful if there are many forwarding actions and each of them should use the same template. Prefer use of the template parameter (module or action) instead.

### Module Parameters

Parameter | Summary
--- | ---
socketName | This is the name of the socket.
socketType | This is the type of the socket (DGRAM, STREAM, SEQPACKET).
abstract | This indicates whether the socketName should be used as an abstract socket address or not.
networkNamespace | This is the name of the network namespace.
template | Sets the template for formatting messages sent to the program.

### Action Parameters

These parameters can be used with the “action()” statement.

Parameter | Summary
--- | ---
socketName | This is the name of the socket.
socketType | This is the type of the socket (DGRAM, STREAM, SEQPACKET).
abstract | This indicates whether the socketName should be used as an abstract socket address or not.
networkNamespace | This is the name of the network namespace.
template | Sets the template for formatting messages sent to the program.

## Caveats/Known Bugs

Prior to version v8.2512, only datagram sockets were supported.

As of v8.2512, datagram and stream socket types are supported. In addition, sequenced packet socket types and abstract socket addresses are supported when implemented by the underlying operating system (in general, this is only Linux).

## Examples

### Write all messages to socket (version 1)

The following sample writes all messages to the “/tmp/socksample” socket. This uses the original (now deprecated) syntax.

    $ModLoad omuxsock
    $OMUxSockSocket /tmp/socksample
    *.* :omuxsock:

### Write all messages to socket (version 2)

The following sample writes all messages to the “/tmp/socksample” socket. This is the same as the previous example, except using module parameters. This can be considered a short-hand style to avoid configuring an instance.

    module(
        load = "omuxsock"
        SocketName = "/tmp/socksample"
    )
    *.* :omuxsock:

### Write all messages to socket (version 3)

The following sample writes all messages to the “/tmp/socksample” socket. This is the same as the previous two examples, except using instance parameters.

    module(
        load = "omuxsock"
    )
    *.* {
        action(
            type = "omuxsock"
            SocketName = "/tmp/socksample"
        )
    }

### Write messages to multiple sockets

The following sample writes messages to different sockets based on a filter. In addition, it shows how abstract sockets, socket types, and network namespaces can be used. Note that abstract sockets do not use names in the filesystem.

    module(
        load = "omuxsock"
    )
    *.* {
        action(
            type = "omuxsock"
            SocketName = "/tmp/socksample"
            SocketType = "DGRAM"
        )
    }
    *.* {
        action(
            type = "omuxsock"
            SocketName = "local"
            Abstract = "1"
            SocketType = "SEQPACKET"
            NetworkNamespace = "routing"
        )
    }
    :msg, contains, "ERROR" {
        action(
            type = "omuxsock"
            SocketName = "syslog/errors"
            Abstract = "1"
            SocketType = "STREAM"
            NetworkNamespace = ""
        )
    }

Support: rsyslog Assistant | GitHub Discussions | GitHub Issues: rsyslog source project

Contributing: Source & docs: rsyslog source project

© 2008–2025 Rainer Gerhards and others. Licensed under the Apache License 2.0.