# Frequently Asked Questions (FAQ) ## General Questions ### What is systemd-netlogd? systemd-netlogd is a lightweight daemon that forwards systemd journal logs to remote syslog servers over the network. It's designed for centralized logging without local storage impact. ### How is it different from systemd-journal-remote? | Feature | systemd-netlogd | systemd-journal-remote | |---------|-----------------|------------------------| | Direction | Local → Remote (push) | Remote → Local (pull) | | Protocol | Syslog (RFC 5424/3339) | systemd Journal Export | | Use Case | Send logs to syslog servers | Receive logs from remote systemd hosts | | Storage | Zero buffering | Stores in local journal | ### Why not use rsyslog or syslog-ng? You can! systemd-netlogd is complementary: - **Simpler**: Fewer configuration options, easier to deploy - **Lighter**: Minimal resource footprint - **Native**: Reads directly from systemd journal (no imjournal module needed) - **Focused**: One job - forward journal to network Use rsyslog/syslog-ng if you need: - Complex routing rules - Local log processing - Non-journal sources ## Installation and Setup ### Do I need root privileges to run systemd-netlogd? No. It runs as the unprivileged `systemd-journal-netlog` user. Root is only needed for: - Installation - Creating the system user - Managing the systemd service ### What systemd version is required? **Minimum**: systemd v230 (released 2016) **Recommended**: systemd v255+ for full features Check your version: ```bash systemctl --version ``` ### Can I install it without building from source? Yes, packages are available for some distributions: - **Ubuntu**: Plucky, Quokka, Raccoon and later: `sudo apt install systemd-netlogd` - **Fedora**: Search COPR repositories - **Arch Linux**: AUR package `systemd-netlogd-git` ## Configuration ### Where is the configuration file? Main config: `/etc/systemd/netlogd.conf` Drop-in configs: `/etc/systemd/netlogd.conf.d/*.conf` Use drop-ins for environment-specific overrides: ```bash sudo mkdir -p /etc/systemd/netlogd.conf.d sudo tee /etc/systemd/netlogd.conf.d/production.conf <1 2024-01-20T10:30:15.123456+00:00 hostname myapp 1234 - - User logged in ``` - Version field (1) - Structured data support - Modern syslog standard **RFC 3164** (legacy): ``` <34>2024-01-20T10:30:15.123456+00:00 hostname myapp[1234]: User logged in ``` - BSD syslog format - No structured data - Compatible with older servers **Use RFC 5424** unless your server doesn't support it. ### What is RFC 5425? RFC 5425 is the TLS transport mapping for syslog. It uses length-prefixed framing: ``` 123 <34>1 2024-01-20T10:30:15... ``` systemd-netlogd automatically uses RFC 5425 framing when: ```ini Protocol=tls LogFormat=rfc5425 ``` ### Can I add custom fields to log messages? Yes, using structured data: ```ini [Network] LogFormat=rfc5424 StructuredData=[app@12345 env="production" region="us-east"] ``` Or extract from journal: ```ini UseSysLogStructuredData=yes UseSysLogMsgId=yes ``` Then tag journal entries: ```c sd_journal_send( "MESSAGE=Event occurred", "SYSLOG_STRUCTURED_DATA=[app@12345 user=\"alice\"]", "SYSLOG_MSGID=EVENT001", NULL ); ``` ## Journal and Storage ### Does systemd-netlogd buffer messages to disk? No. It reads the journal sequentially and forwards immediately. This is intentional for: - Minimal storage impact - Real-time forwarding - Simplicity ### What happens if I send more logs than the network can handle? 1. **Rate limiting**: Default 10 messages per 10 seconds prevents flooding 2. **Backpressure**: If network is slow, journal reading pauses 3. **No message loss**: Cursor tracks position, messages replayed on reconnect ### Can I forward logs from a specific namespace? Yes: ```ini [Network] # Forward only from namespace "app" Namespace=app # Forward from all namespaces Namespace=* # Forward from default + namespace "app" Namespace=+app ``` ### How do I monitor the journal cursor position? Check the state file: ```bash sudo cat /var/lib/systemd-netlogd/state ``` Shows: ``` LAST_CURSOR=s=abc123def456... ``` This cursor tracks the last successfully forwarded entry. ### Can I start forwarding from a specific point in time? Yes, use the cursor option: 1. Get cursor for a timestamp: ```bash journalctl --since="2024-01-20 10:00:00" --show-cursor ``` 2. Edit state file: ```bash sudo tee /var/lib/systemd-netlogd/state <