Repository navigation
Expand file tree
/
Copy pathnamespace.conf
More file actions
50 lines (46 loc) · 1.62 KB
/
Copy pathnamespace.conf
File metadata and controls
50 lines (46 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Journal Namespace Configuration
# Forward logs from a specific systemd journal namespace
# Useful for isolating application logs or multi-tenant systems
[Network]
Address=logs.example.com:514
Protocol=tcp
LogFormat=rfc5424
# Forward only logs from the "webapp" namespace
# Journal namespaces are created with: systemd-journald@webapp.service
Namespace=webapp
# Alternative: Forward logs from a specific journal directory
# This reads journal files from a custom location
# Dir=/var/log/journal/remote
# Use case examples:
#
# 1. Multi-tenant logging:
# - Create namespace per tenant: systemd-journald@tenant1.service
# - Configure separate systemd-netlogd instances per tenant
# - Forward to tenant-specific syslog destinations
#
# 2. Application isolation:
# - Run app with: systemd-run --unit=myapp -p LogNamespace=myapp ./myapp
# - Forward myapp logs to dedicated log server
# - Keep application logs separate from system logs
#
# 3. Security compartmentalization:
# - Sensitive logs in isolated namespace
# - Forward to secure SIEM system
# - Regular logs to standard syslog
#
# Setting up a namespace:
#
# 1. Create the namespace journald instance:
# sudo systemctl enable systemd-journald@webapp.service
# sudo systemctl start systemd-journald@webapp.service
#
# 2. Run applications in the namespace:
# systemd-run --unit=mywebapp -p LogNamespace=webapp /usr/bin/mywebapp
#
# 3. Configure systemd-netlogd to forward namespace logs (this file)
#
# 4. Verify logs are being written to namespace:
# journalctl --namespace=webapp -f
#
# 5. Verify systemd-netlogd is forwarding:
# journalctl -u systemd-netlogd -f