CREATE DATABASE syslog;
USE syslog;
CREATE TABLE SystemEvents
   (
    ID int unsigned not null auto_increment primary key,
    ReceivedAt datetime NULL,
    DeviceReportedTime datetime NULL,
    Facility smallint NULL,
    FacilityText varchar(100) NULL,
    Priority smallint NULL,
    PriorityText varchar(10) NULL,
    FromHost varchar(60) NULL,
    FromHostIp varchar(20) NULL,
    Hostname varchar(60) NULL,
    Message text,
    SysLogTag varchar(60)
   );

CREATE INDEX ReceivedAt on SystemEvents(ReceivedAt);
CREATE INDEX DeviceReportedTime on SystemEvents(DeviceReportedTime);
CREATE INDEX Facility on SystemEvents(Facility);
CREATE INDEX FacilityText on SystemEvents(FacilityText);
CREATE INDEX Priority on SystemEvents(Priority);
CREATE INDEX PriorityText on SystemEvents(PriorityText);
CREATE INDEX FromHost on SystemEvents(FromHost);
CREATE INDEX FromHostIp on SystemEvents(FromHostIp);
CREATE INDEX Hostname on SystemEvents(Hostname);
CREATE INDEX SysLogTag on SystemEvents(SysLogTag);

CREATE FULLTEXT INDEX Message on SystemEvents(Message);