반응형
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
반응형
'리눅스' 카테고리의 다른 글
warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory (0) | 2018.10.02 |
---|---|
[리눅스] RVM ruby install (0) | 2018.07.19 |
CentOS 7에서 오라클 자바(Oracle JDK)를 설치하는 방법 (0) | 2018.06.25 |
CentOS 7에서 Remi RPM 저장소를 사용하여 PHP 7.2를 설치하는 방법 (0) | 2018.06.19 |
CentOS 6에 rsyslog 7을 설치하는 방법 (0) | 2018.06.08 |