변군이글루

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

서___리눅스

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

변군 변군이글루 2018.06.27 12:25


리눅스 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

 

0 Comments
댓글쓰기 폼