Advertisement
m4ly

mysql + rsyslog

May 31st, 2015
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 2.21 KB | None | 0 0
  1. CREATE DATABASE IF NOT EXISTS rsyslog;
  2. USE rsyslog;
  3. DROP TABLE IF EXISTS SystemEvents;
  4. CREATE TABLE IF NOT EXISTS SystemEvents
  5. (
  6.         ID int unsigned not null auto_increment,
  7.         CustomerID bigint,
  8.         ReceivedAt timestamp NULL,
  9.         DeviceReportedTime timestamp NULL,
  10.         Facility smallint NULL,
  11.         Priority smallint NULL,
  12.         FromHost varchar(60) NULL,
  13.         Message text,
  14.         NTSeverity int NULL,
  15.         Importance int NULL,
  16.         EventSource varchar(60),
  17.         EventUser varchar(60) NULL,
  18.         EventCategory int NULL,
  19.         EventID int NULL,
  20.         EventBinaryData text NULL,
  21.         MaxAvailable int NULL,
  22.         CurrUsage int NULL,
  23.         MinUsage int NULL,
  24.         MaxUsage int NULL,
  25.         InfoUnitID int NULL ,
  26.         SysLogTag varchar(60),
  27.         EventLogType varchar(60),
  28.         GenericFileName VarChar(60),
  29.         SystemID int NULL,
  30.         PRIMARY KEY(`ID`,`DeviceReportedTime`)
  31.         -- KEY(`DeviceReportedTime`)
  32. )
  33. PARTITION BY RANGE (UNIX_TIMESTAMP(`DeviceReportedTime`)) (
  34.         PARTITION p042015 VALUES LESS THAN (UNIX_TIMESTAMP('2015-05-01 00:00:00')),
  35.         PARTITION p052015 VALUES LESS THAN (UNIX_TIMESTAMP('2015-06-01 00:00:00')),
  36.         PARTITION p062015 VALUES LESS THAN (UNIX_TIMESTAMP('2015-07-01 00:00:00')),
  37.         PARTITION p072015 VALUES LESS THAN (UNIX_TIMESTAMP('2015-08-01 00:00:00')),
  38.         PARTITION p082015 VALUES LESS THAN (UNIX_TIMESTAMP('2015-09-01 00:00:00')),
  39.         PARTITION p092015 VALUES LESS THAN (UNIX_TIMESTAMP('2015-10-01 00:00:00')),
  40.         PARTITION p102015 VALUES LESS THAN (UNIX_TIMESTAMP('2015-11-01 00:00:00')),
  41.         PARTITION p112015 VALUES LESS THAN (UNIX_TIMESTAMP('2015-12-01 00:00:00')),
  42.         PARTITION p122015 VALUES LESS THAN (UNIX_TIMESTAMP('2016-01-01 00:00:00')),
  43.         PARTITION pmax    VALUES LESS THAN MAXVALUE
  44. );
  45.  
  46. DROP TABLE IF EXISTS SystemEventsProperties;
  47. CREATE TABLE IF NOT EXISTS SystemEventsProperties
  48. (
  49.         ID int unsigned not null auto_increment primary key,
  50.         SystemEventID int NULL ,
  51.         ParamName varchar(255) NULL ,
  52.         ParamValue text NULL
  53. );
  54.  
  55. GRANT ALL ON syslog.* TO 'rsyslog'@'localhost' IDENTIFIED BY 'dupa123';
  56. FLUSH PRIVILEGES;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement