Rsyslog : MySQL Error ๋ก๊ทธ์ Slow-Query ์ทจํฉ์ ์ํ ์ค์
1. rsyslog conf ์ค์
1-1. ์ค์
vi/etc/rsyslog.d/80-mysql.conf
#variables required for non-syslog log file forwarding โ mysql error
#edit on your location
input(type=โimfileโ
File=โ/var/log/mysqld.logโ
Tag=โmysqld-errorsโ
Severity=โerrorโ
Facility=โlocal7โณ)
input(type=โimfileโ
File=โ/var/log/mysql-slow.logโ
Tag=โmysql-slowโ
Severity=โnoticeโ
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 == โmysqld-errorsโ then /var/log/plura/ceelog-127.0.0.1.log;CEETemplate
:programname, isequal, โmysqld-errorsโ ~
if $programname == โmysql-slowโ then /var/log/plura/ceelog-127.0.0.1.log;CEETemplate
:programname, isequal, โmysql-slowโ ~