I have the following table created :
CREATE TABLE Trailtbl( userid char(50), action varchar(150), timestamp
varchar(30), service char(20), resources varchar(200), accountid varchar(30),
awsregion varchar(20), roleid varchar(100), eventid varchar(100));
The table is supposed to contain AWS Cloudtrail logs. I set up a MySQL event like this :
CREATE EVENT AutoDeleteOldNotifications
-> ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 MINUTE
-> ON COMPLETION PRESERVE
-> DO
-> DELETE FROM testdb.Trailtbl WHERE datetime <DATE_SUB(NOW(),
INTERVAL 10 MINUTE);
What am I doing wrong here ? Why is the log data older than 10 minutes not getting deleted from the table ? Please explain. Any help is greatly appreciated.