Parse log into the database