updated all sql queries to work with ossec 2.8