collectd: Send metrics to collectd

The collectd() destination uses the unixsock plugin of the collectd application to send log messages to the collectd system statistics collection daemon. You must install and configure collectd separately before using this destination.

Prerequisites

  • AxoSyslog version 3.20 or later.

  • Install the axosyslog-scl package on Debian/Ubuntu. On RHEL and compatible distributions, the SCL files are part of the axosyslog base package.

    Your configuration must also contain @include "scl.conf", which the default configuration file already does. If the SCL files are missing, AxoSyslog fails to start with an unexpected LL_IDENTIFIER error.

    Terminal window
    @include "scl.conf"

    The collectd() driver is a reusable configuration snippet (SCL). For details on using or writing such configuration snippets, see Reusing configuration blocks. You can find its source in scl/collectd/plugin.conf on GitHub.

Declaration:

Terminal window
   destination d_collectd {
      collectd(
        socket("<path-to-collectd-socket>"),
        host("${HOST}"),
        plugin("${PROGRAM}"),
        type("<type-of-the-collected-metric>"),
        values("<metric-sent-to-collectd>"),
      );
    };

Example: Using the collectd() driver

The following example uses the name of the application sending the log message as the plugin name, and the value of the ${SEQNUM} macro as the value of the metric sent to collectd.

Terminal window
   destination d_collectd {
      collectd(
        socket("/var/run/collectd-unixsock"),
        host("${HOST}"),
        plugin("${PROGRAM}"),
        type("gauge"),
        type_instance("seqnum"),
        values("${SEQNUM}"),
      );
    };
Last modified August 5, 2026: Small fixes and deduplications (99cac43a)