§2024-05-16
- files in /etc/syslog-ng directory
alexlai@hc4nas02:~$ ls /etc/syslog-ng/
conf.d patterndb.d scl.conf syslog-ng.conf syslog-ng.conf.backup
alexlai@hc4nas02:~$ syslog-ng --version
syslog-ng 3 (3.25.1)
Config version: 3.25 <-- put in @version
Installer-Version: 3.25.1
Revision: 3.25.1-3
Compile-Date: Mar 3 2020 19:39:43
....
- /etc/syslog-ng/scl.conf
....
@include 'scl/*/*.conf'
/etc/syslog-ng/
├── syslog-ng.conf
└── scl/
├── sources/
│ └── my_sources.conf
├── destinations/
│ └── my_destinations.conf
└── filters/
└── my_filters.conf
- a Simple config file, by chatGPT
@version: 3.25 # not necessary but it it good to have it here
@include "scl.conf" # include configuration files in
# Set up the source
source s_net {
tcp(ip(0.0.0.0) port(514));
udp(ip(0.0.0.0) port(514));
};
# Set up the destination
destination d_file {
file("/var/log/syslog-ng/messages.log");
};
# Log everything from the source to the destination
log {
source(s_net);
destination(d_file);
};