Apache httpd error 로그 수집
80-httpd.conf → conf 파일 생성하기
# cd /etc/rsyslog.d/ 
# vi /etc/rsyslog.d/80-httpd.conf
File = “로그 경로”, Tag = “태그”, Severity = “심각도”, programname = “프로그램명”
# vi /etc/rsyslog.d/80-httpd.conf
 #variables required for non-syslog log file forwarding – httpd error log file
 #edit on your location
 input(type=”imfile”
 File=”/var/log/httpd/error_log”
 Tag=”httpd”
 Severity=”error”
 Facility=”local7″)
 ###### Creates a template for each log file in the Logentries UI
 ### logic to apply the relevant templates to the different log files
 if $programname == ‘httpd‘ then /var/log/plura/ceelog-127.0.0.1.log;CEETemplate
 :programname, isequal, ‘httpd‘ stop
# wget https://repo.plura.io/v5/module/rsyslog/80-httpd.conf
# curl https://repo.plura.io/v5/module/rsyslog/80-httpd.conf -o /etc/rsyslog.d/80-httpd.conf
# service rsyslog restart
로그 예시 : 전체로그 > 호스트
위 내용을 활용해서 필터를 등록하면 탐지로그를 확인할 수 있습니다.
외부 참고 사이트
https://www.rsyslog.com/doc/v8-stable/configuration/modules/imfile.html