I want to know how to send new login and logout logs to a database.
I know that
last command outputs the "lasts" login info.
But, I found the following problems:
- How to filter to only get new logs? How can I identify them?
- How many time is saved in the
utmpfile? How many time should I wait to refresh it? Should I access
- Is there any other way?
- Can I use
rsyslog.congto copy the log info to a MySQL database or to a PHP (local or remote)?
- Other users shuold not be able to delete the logs before script/deamon send it to the database.
- Other users should not be able to falsify logs entries.
I'm trying to solve this for several days... Thanks!