1
This commit is contained in:
commit
f0ee0d70e0
6
0010-install-syslog-ng.sh
Executable file
6
0010-install-syslog-ng.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
apt update
|
||||
apt install syslog-ng -y
|
||||
|
||||
|
25
Makefile
Normal file
25
Makefile
Normal file
@ -0,0 +1,25 @@
|
||||
all:
|
||||
echo OK
|
||||
|
||||
install-dependencies:
|
||||
bash 0001-install-deps.sh
|
||||
|
||||
install-syslog-ng:
|
||||
bash 0010-install-syslog-ng.sh
|
||||
|
||||
configure-syslog-ng:
|
||||
cp -vf net-hosts.conf /etc/syslog-ng/conf.d/net-hosts.conf
|
||||
mkdir /var/log/remote -p
|
||||
chown -Rv root:syslog /var/log/remote
|
||||
systemctl reload syslog-ng
|
||||
|
||||
configure-logrotate:
|
||||
cp -vf remote_logs /etc/logrotate.d/remote_logs
|
||||
|
||||
run-logrotate:
|
||||
/usr/sbin/logrotate -v /etc/logrotate.d/remote_logs
|
||||
|
||||
force-logrotate:
|
||||
/usr/sbin/logrotate -vf /etc/logrotate.d/remote_logs
|
||||
|
||||
|
9
net-hosts.conf
Normal file
9
net-hosts.conf
Normal file
@ -0,0 +1,9 @@
|
||||
source s_network_udp { syslog(ip(0.0.0.0) transport("udp") keep-hostname(no)); };
|
||||
source s_network_tcp { tcp(ip(0.0.0.0) port(514) keep-hostname(no)); };
|
||||
|
||||
|
||||
destination d_netlog { file("/var/log/remote/${HOST}.log"); };
|
||||
|
||||
log { source(s_network_udp); destination(d_netlog);};
|
||||
log { source(s_network_tcp); destination(d_netlog);};
|
||||
|
9
remote_logs
Normal file
9
remote_logs
Normal file
@ -0,0 +1,9 @@
|
||||
/var/log/remote/*.log {
|
||||
rotate 30
|
||||
daily
|
||||
dateext
|
||||
compress
|
||||
missingok
|
||||
delaycompress
|
||||
copytruncate
|
||||
}
|
Loading…
Reference in New Issue
Block a user