rsyslog
Aug 30, 2008 - 09:48 AM

Donate!
Satisfied with rsyslog?

Donate and help keep
the project alive!

Rainer's Blog

Login




 


 Log in Problems?
 New User? Sign Up!

Online
There are 19 unlogged users and 0 registered users online.

You can log-in or register for a user account here.

FAQ
FAQ  :: How to automatically delete database contents? ::
(4197 Reads)  
Posted by rgerhards on Tuesday, November 15, 2005 - 09:31 PM

Rsyslog supports writing to the database. Like with log files, the rsyslogd writes the data, but does not delete (or export) it. If you need the data only for a period of time, simply deleting excess data might be a workable solution.

Below are some examples how this can be done (thanks to Michael Meckelein for posting this in the forum):

You can start a script via cron job, e. g.

mysql -u database-userid -pdatabase-password -e "truncate table SystemEvents" database-name

to delete all data or like

mysql -u database-userid -pdatabase-password -e "DELETE FROM SystemEvents WHERE ReceivedAt < date_add(current_date, interval -1 day)" database-name

to delete data older than one day.

Send this story to someone  Printer-friendly page
Only logged in users are allowed to comment. register/log in
 Search
 
Google

 Last Forum Posts
 · Mikrotik Logging, incorrect FROMHOST ...
I've got rsyslog and phplogcon all up and running but having one ...
· Re: wrong format from windows event log ...
Yes, that's exactly also my intention: all events from several W2 ...
· Re: wrong format from windows event log ...
Glad to hear it's working. I wouldn't count on the RFCs for a who ...
· Re: wrong format from windows event log ...
Yup... that's a miracle, as we say here in Italy... if you tell t ...
· Re: wrong format from windows event log ...
Thx, I didn't very well my homework... sorry.I'll try this and co ...

 Top Contributors
 
Contributor Contribs
varmojfekoj 7
Michael Biebl 2
Michel Biebl 1
Peter Vrabec 1



:: Syndication: ::
Page created in 0.129554986954 seconds.