--- title: "Secure log transfer using Rsyslog" slug: "secure-log-transfer-using-rsyslog-v7-0" description: "Securely transfer logs from AppGate ZTNA to an external SIEM using Rsyslog and TLS. Follow our guide for configuration and verification steps." tags: ["Rsyslog", "Logging", "Secure Log Transfer"] updated: 2026-06-05T19:17:40Z published: 2026-06-05T19:17:40Z canonical: "support.appgate.com/secure-log-transfer-using-rsyslog-v7-0" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.appgate.com/llms.txt > Use this file to discover all available pages before exploring further. # Secure log transfer using Rsyslog You can transfer logs from AppGate ZTNA appliances to an external SIEM system. By default, AppGate ZTNA uses Rsyslog for log transfer, which does not provide transport security on its own. You can secure the transmission by configuring both systems to use TLS. --- ## Prerequisites Before you begin, confirm the following: - The remote Rsyslog server runs Rsyslog version 8.16.0 or later. - The `rsyslog-gnutls` plugin is installed on the remote server. - TLS certificates have been generated for the transport. For information on generating a CA, see [Generating the machine certificate](https://docs.rsyslog.com/doc/tutorials/tls_cert_machine.html). The remote Rsyslog server requires `ca.pem`, `cert.pem`, and `key.pem`. The AppGate ZTNA appliance requires only `ca.pem`. On the AppGate ZTNA appliance, the key must be stored in the `/opt` directory. The examples in this article use `/opt/Keys` on the AppGate ZTNA appliance and `/home/ubuntu/Keys` on the remote Rsyslog server. Create these directories before proceeding. --- ## Configure the remote Rsyslog server The following steps were tested on Ubuntu 16.04 with Rsyslog v8.16.0 and `rsyslog-gnutls` installed. On the Rsyslog server, open `etc/rsyslog.conf`: ```plaintext sudo nano /etc/rsyslog.conf ``` Add the following lines: ```plaintext # make gtls driver the default $DefaultNetstreamDriver gtls # certificate files $DefaultNetstreamDriverCAFile /home/ubuntu/Keys/ca.pem $DefaultNetstreamDriverCertFile /home/ubuntu/Keys/cert.pem $DefaultNetstreamDriverKeyFile /home/ubuntu/Keys/key.pem # load TCP listener $ModLoad imtcp # run driver in TLS-only mode $InputTCPServerStreamDriverMode 1   # client is NOT authenticated $InputTCPServerStreamDriverAuthMode anon # start up listener at port 10514 $InputTCPServerRun 10514 ``` --- ## Configure the AppGate ZTNA appliance 1. Create the `/opt/Keys` directory on the appliance: ```plaintext sudo mkdir /opt/Keys ``` 1. Copy `ca.pem` into the `/opt/Keys` directory. 2. In the admin UI, go to System > Appliances > Edit Appliance > Networking > Advanced > Rsyslog Destinations and select **+Add**. ![Configuration settings for Rsyslog Destination including selector, template, and destination IP.](https://cdn.us.document360.io/e7482ce5-acfa-4c3b-b76c-b6c32472644a/Images/Documentation/ag42-rsyslog.png?sv=2026-02-06&spr=https&st=2026-11-21T21%3A39%3A58Z&se=2026-11-21T22%3A39%3A58Z&sr=b&sp=r&sig=OaPgDWW1VOULhvg8OUMhGLLcknLrHtaRO6azCHNh4OI%3D) 3. In the ***Selector*** field, paste the following: ```plaintext # certificate files - just CA for a client $DefaultNetstreamDriverCAFile /opt/Keys/ca.pem # set up the action $DefaultNetstreamDriver gtls # use gtls netstream driver $ActionSendStreamDriverMode 1 $ActionSendStreamDriverAuthMode anon # server is NOT authenticated :msg, contains, "[AUDIT]" ``` > [!NOTE] > NOTE > > The last line `:msg, contains, "[AUDIT]"` sends only logs marked with `[AUDIT]`, which all audit logs include. Because audit logs and syslogs are stored in the same file, replace the last line with `*.*` to forward all logs. 4. In the ***Template*** field, enter the following: ```plaintext %msg:9:$%\n ``` 1. In the ***Destination*** field, enter the destination of the remote Rsyslog server you are sending logs to: ```plaintext @@(o)ec2-18-218-62-238.us-east-2.compute.amazonaws.com:10514 ``` This example sends logs to `ec2-18-218-62-238.us-east-2.compute.amazonaws.com` on port 10514. 1. Select **Save** at the bottom of the **Edit Appliance** page. 2. Confirm that port 10514 is open between the AppGate ZTNA appliance and the remote Rsyslog server. After the configuration is saved, logs are forwarded to the remote server and stored in `/var/log/syslog`. ### Verify the configuration To confirm that logs are being sent, use one of the following methods: - Check `/var/log/syslog` on the remote Rsyslog server and confirm that logs are being written. - Run a `tcpdump` on the remote Rsyslog server: ```plaintext sudo tcpdump -i port 10514 ``` For more information about logs, see [Audit logs](/v1/docs/audit-logs-v7-0). For information about audit log record details, see [Audit log detail](/v1/docs/audit-log-detail-v7-0).