# Configuring AxoSyslog on relay hosts

To configure AxoSyslog on a relay host, complete the following steps:

  1. Install the AxoSyslog application on the host. For details on installing AxoSyslog on specific operating systems, see [Install AxoSyslog](../../../docs/axosyslog-core/4.26/install/index.md).

  2. Configure the network sources that collect the log messages sent by the clients.

  3. Create a network destination that points to the AxoSyslog server.

Note If both your clients (or the relay) and the upstream server run AxoSyslog, you can use the OpenTelemetry protocol on both legs instead of the syslog protocol: receive messages with an `axosyslog-otlp()` source and forward them with an `axosyslog-otlp()` destination. The `axosyslog-otlp()` driver is available in AxoSyslog version 4.12 and later, and requires the `axosyslog-grpc` (or `axosyslog-mod-grpc`) package. For details, see [axosyslog-otlp(): Receive logs from another node using OpenTelemetry](../../../docs/axosyslog-core/4.26/chapter-sources/source-syslog-ng-otlp/index.md) and [axosyslog-otlp(): Forward logs to another node using OpenTelemetry](../../../docs/axosyslog-core/4.26/chapter-destinations/destination-syslog-ng-otlp/index.md). 

  4. Create a log statement connecting the network sources to the AxoSyslog server.

  5. Configure the local sources that collect the log messages of the relay host.

  6. Create a log statement connecting the local sources to the AxoSyslog server.

  7. Enable the `keep-hostname()` and disable the `chain-hostnames()` options. (For details on how these options work, see [Global options](../../../docs/axosyslog-core/4.26/chapter-global-options/reference-options/index.md).)

Note It is recommended to use these options on your AxoSyslog server as well. 

  8. Set filters and options (for example, TLS encryption) as necessary.

Note

By default, the AxoSyslog server treats the relayed messages as if they were created by the relay host, not the host that originally sent them to the relay. In order to use the original hostname on the AxoSyslog server, use the `keep-hostname(yes)` option both on the AxoSyslog relay and the AxoSyslog server. This option can be set individually for every source if needed.

If you are relaying log messages and want to resolve IP addresses to hostnames, configure the first relay to do the name resolution.




## Example: A simple configuration for relays

The following is a simple configuration file that collects local and incoming log messages and forwards them to a logserver using the IETF-syslog protocol.

Terminal window
```
    @version: 4.26
    @include "scl.conf"
    options {
        time-reap(30);
        mark-freq(10);
        keep-hostname(yes);
        chain-hostnames(no);
    };
    source s_local {
        system(); internal();
    };
    source s_network {
        syslog(transport(tcp));
    };
    destination d_syslog_tcp {
        syslog("192.168.1.5" transport("tcp") port(2010));
    };
    log {
        source(s_local); source(s_network);
        destination(d_syslog_tcp);
    };
```

## Example: A relay configuration using OpenTelemetry

The following relay configuration receives log messages from AxoSyslog clients over the OpenTelemetry protocol and forwards them to the upstream AxoSyslog server using the same protocol.

Terminal window
```
    @version: 4.26
    @include "scl.conf"
    options {
        time-reap(30);
        mark-freq(10);
        keep-hostname(yes);
        chain-hostnames(no);
    };
    source s_local {
        system(); internal();
    };
    source s_network {
        axosyslog-otlp(port(4317));
    };
    destination d_otlp {
        axosyslog-otlp(url("192.168.1.5:4317"));
    };
    log {
        source(s_local); source(s_network);
        destination(d_otlp);
    };
```

Last modified June 17, 2026: [Markdown formatting fixes in related files (424a542a)](<https://github.com/axoflow/axosyslog-core-docs/commit/424a542aae38674041d024816abd488b4ed65526>)