參考資源:HOWTO : Rsyslog + MySQL on FreeBSD
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
CREATE DATABASE Syslog; USE Syslog; CREATE TABLE SystemEvents ( ID int unsigned not null auto_increment primary key, CustomerID bigint, ReceivedAt datetime NULL, DeviceReportedTime datetime NULL, Facility smallint NULL, Priority smallint NULL, FromHost varchar(60) NULL, Message text, NTSeverity int NULL, Importance int NULL, EventSource varchar(60), EventUser varchar(60) NULL, EventCategory int NULL, EventID int NULL, EventBinaryData text NULL, MaxAvailable int NULL, CurrUsage int NULL, MinUsage int NULL, MaxUsage int NULL, InfoUnitID int NULL , SysLogTag varchar(60), EventLogType varchar(60), GenericFileName VarChar(60), SystemID int NULL ); CREATE TABLE SystemEventsProperties ( ID int unsigned not null auto_increment primary key, SystemEventID int NULL , ParamName varchar(255) NULL , ParamValue text NULL ); |
1 |
mysql> grant all privileges on Syslog.* to 'sysloguser'@'%' identified by 'syslogpass' with grant option |
1 2 3 |
cd /usr/ports/sysutils/rsyslog7 make install clean ee /usr/local/etc/rsyslog.conf |
RHEL 6.x 搭建rsyslog日志服务器和loganalyzer 日志分析工具
1 2 3 4 5 |
$ModLoad imuxsock.so $ModLoad imklog $ModLoad immark $ModLoad ommysql *.* :ommysql:localhost,Syslog,sysloguser,syslog |
1 |
/usr/local/etc/rc.d/rsyslogd restart |
--
957 total views, 1 views today