Ubiquiti
LogZilla App Store application: Ubiquiti
Overview
Ubiquiti UniFi Dream Machine Pro (UDM Pro) is an all-in-one networking console that runs UniFi OS applications, including Network and Protect. It features a built-in security gateway, 10G SFP+ WAN support, an 8-port Gigabit switch, and network video recorder support.
Critical Configuration Requirement
BEFORE using this app, Ubiquiti devices MUST be configured to send logs to a dedicated LogZilla port.
UniFi devices use non-standard syslog formatting that requires special handling. Sending logs to the standard syslog port (514) will result in parsing failures.
Required Configuration:
- Dedicated syslog port (e.g., 5514) configured in LogZilla
- Ubiquiti devices configured to send logs to this dedicated port
- Required Linux apps installed (see below)
Next Steps: See the "Setting Up Dedicated Ports" section below for complete configuration instructions.
Required Dependencies
IMPORTANT: Install these LogZilla apps BEFORE configuring Ubiquiti logging:
- Linux__iptables App - Required for processing firewall logs
- Linux__dhcpd App - Required for processing DHCP logs
Without these apps, Ubiquiti logs will be identified but won't receive detailed parsing and tagging for specific Linux services.
App Function
The Ubiquiti app performs the following functions:
- SSH Authorization Processing: Recognizes SSH authorization messages and creates user tags for authentication tracking
- Event Filtering: Identifies non-actionable events and marks them accordingly to reduce noise
Vendor Documentation
Ubiquiti Unifi log messages are essentially standard linux syslog messages, with the addition of a few messages from Unifi-specific programs.
Incoming Log Format
The incoming log format is that of standard linux syslog log messages. The Ubiquiti UDM Pro log messages are received as syslog data packets.
For the SSH logs, the user tags are set as follows:
SSH User Tags
| Tagged | Tag Name | Example | Description |
|---|---|---|---|
| ☑ | program | SSH Auth | designation of ssh authorization |
| ☑ | user | root | linux user |
| ☑ | SrcIP | 192.168.0.1 | source IPv4 address |
| ☑ | SrcPort | 12345 | source port |
Log Examples
UDM Child Connection (to be set non-actionable)
textChild connection from 127.0.0.1:46230
UDM Parsed Request (to be set non-actionable)
text04[ENC] parsed INFORMATIONAL_V1 request 2016269085 [ HASH N(DPD_ACK) ]
Firewall Log Message #1
textDESCR="[WAN_LOCAL]Block All Other Tra" IN=eth8 OUT= MAC=f4:92:bf:72:e4:fc:cc:79:d7:46:ce:af:08:00 SRC=80.64.30.221 DST=206.196.19.4 LEN=40 TOS=00 PREC=0x00 TTL=242 ID=55856 PROTO=TCP SPT=44761 DPT=47838 SEQ=2867950570 ACK=0 WINDOW=1024 SYN URGP=0 MARK=1a0000
Firewall Log Message #2
textDESCR="no rule description" IN=br10 OUT= MAC=f4:92:bf:72:e4:fe:8a:7a:3b:e7:7f:31:08:00 SRC=192.168.10.151 DST=192.168.10.1 LEN=52 TOS=00 PREC=0x00 TTL=63 ID=53957 DF PROTO=TCP SPT=45132 DPT=443 SEQ=682224580 ACK=3544759213 WINDOW=4449 ACK URGP=0 UID=125 GID=132 MARK=1a0000
Firewall Log Message #3
text[LAN_LOCAL-RET-2147483647] DESCR=\"no rule description\" IN=br10 OUT= MAC=f4:92:bf:72:e4:fe:8a:7a:3b:e7:7f:31:08:00 SRC=192.168.10.151 DST=192.168.10.1 LEN=52 TOS=00 PREC=0x00 TTL=63 ID=7571 DF PROTO=TCP SPT=52776 DPT=443 SEQ=2957142958 ACK=2757071578 WINDOW=12949 ACK URGP=0 UID=125 GID=132 MARK=1a0000
MCAD Log Message
textmcad[3886]: mcad[3886]: udapi_cache.udapi_cache_set_global_update_interval(): Bumping global update interval :: interval=20000msec->23000msec
UniFi OS and Linux Integration
Ubiquiti devices run UniFi OS, a Linux derivative that includes standard Linux programs. The dedicated port approach allows LogZilla to:
- Segregate UniFi devices from other Linux implementations
- Benefit from detailed processing of standard Linux log formats
- Provide unified dashboards for Ubiquiti-specific insights
Standard UniFi OS Services
- iptables - Firewall and NAT filtering
- dhcpd - DHCP daemon (if dedicated DHCP is used)
- dnsmasq - Combined DHCP/DNS service
- sshd/dropbear - SSH remote access
- ntpd/systemd-timesyncd - Time synchronization
- kernel - Kernel-generated messages
- systemd - Service management
- rsyslogd/syslog-ng - Log aggregation
Setting Up Dedicated Ports for Ubiquiti
LogZilla supports dedicated syslog ports for specific device types, which can improve performance and allow for better event processing. This guide explains how to set up dedicated syslog sources for Unifi devices.
Configuration Steps
1. Edit the syslog-ng Configuration
Open the syslog-ng configuration file:
bash# Open the config file with your preferred editor
nano /etc/logzilla/syslog-ng/config.yaml
2. Add Custom Unifi Sources
In the sources section of the file, add a new entry for TCP and optionally
UDP:
yamlsources:
# ... existing sources will be here ...
# Add TCP source for Unifi
- name: unifi
enabled: true
type: network
port: 5514 # Choose an unused port
transport: tcp
source_tag: unifi
# Optional: Add UDP source for Unifi
- name: unifi_udp
enabled: true
type: network
port: 5514 # Usually the same port as TCP
transport: udp
source_tag: unifi
The key point is the source_tag: unifi in the syslog-ng configuration, which
matches the SOURCE_FILTER = "unifi" in the Unifi rule. This association
ensures that:
- Only events from the dedicated Unifi port will be processed by the Unifi rule
- Events from other sources will not unnecessarily go through the Unifi processing
- The parser automatically handles the connection between source_tag and SOURCE_FILTER without needing additional configuration
3. Restart Syslog to Apply Changes
Restart the syslog service to apply the configuration:
bashlogzilla restart -c syslog logzilla restart -c parsermodule
4. Configure Your Unifi Devices
Configure your Unifi devices to send logs to these dedicated ports:
- Log in to your Unifi Controller or device admin interface
- Navigate to Settings > System > Advanced
- Under Remote Logging, enable "Remote Logging"
- Enter your LogZilla server IP address
- Set the port to your dedicated port (e.g., 5514)
- Select the appropriate protocol (TCP or UDP)
- Save your settings
5. Verify Configuration
To verify that logs are being received on the dedicated ports, check the Ubiquiti Unifi OS dashboard.
Troubleshooting
If you don't see Unifi logs after configuration:
-
Verify the syslog-ng process is running:
bashlogzilla status -
Check syslog-ng logs for any configuration errors:
bashdocker logs logzilla_syslog -
Check that your port is accessible (not blocked by firewall):
bashnc -zv your_logzilla_server 5514 -
Enable debug logging temporarily to see incoming connections:
bash# Edit the syslog-ng configuration to enable debug options logzilla config syslog_debug 1 # After editing, restart syslog logzilla restart -c syslogView the logs using
bashsudo tail -F /var/log/logzilla/syslog/debug.logOnce troubleshooting is complete, debug logging should be disabled, since it generates extra load on the syslog process and can quickly fill up disk:
bashlogzilla config syslog_debug 0.See Syslog Troubleshooting for more information.
-
Test sending a log message directly to the configured port:
bash# Using logger command to test (from another Linux machine) logger -n your_logzilla_server -P 5514 -T -d "Test message from Unifi device" -
Verify that your Unifi device is configured correctly to send logs to the right IP and port