본문 바로가기

리눅스

[리눅스] syslog(rsyslog)로 로그시스템 구성

반응형

syslog(rsyslog)로 로그시스템 구성

mkdir -p /apps/syslog
vi /etc/rsyslog.d/rsyslog-server.conf
# Provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514

# Provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514

#$template RemoteHost,"/apps/syslog/%$year%/%hostname%/%hostname%-%$year%%$month%%$day%%$hour%.log"
$template RemoteHost,"/apps/syslog/%$year%/%fromhost-ip%/%fromhost-ip%-%$year%%$month%%$day%%$hour%00-%$year%%

$month%%$day%%$hour%59.log"
*.* @@RemoteHost
systemctl restart rsyslog

 

참고URL :
https://www.fibrevillage.com/sysadmin/221-rsyslog-rules-examples-on-linux
https://www.rsyslog.com/doc/master/configuration/properties.html

 

728x90
반응형