How to configure Ubiquiti EdgeRouter to send logs to a Syslog Server

Method 1: using text editor

# Edit the syslog config
sudo vi /etc/rsyslog.d/vyatta-log.conf

# Change the @ = udp symbol to @@ = tcp
# add :PORTNUMBER after node name or IP if necessary
admin@EdgeRouter-4:~$ cat /etc/rsyslog.d/vyatta-log.conf
*.err	@graylog.kimconnect.com
*.notice;local7.debug	-/var/log/messages

Method 2: use sed to update texts

# Change from udp to tcp
sudo sed 's/@/@@/' -i /etc/rsyslog.d/vyatta-log.conf
cat /etc/rsyslog.d/vyatta-log.conf

# Change from tcp to udp
sudo sed 's/@@/@/' -i /etc/rsyslog.d/vyatta-log.conf
cat /etc/rsyslog.d/vyatta-log.conf

# Restart syslogd
sudo service rsyslog restart

Leave a Reply

Your email address will not be published. Required fields are marked *