util: optimize audit log queries via history

Signed-off-by: Pierre-Alexandre Meyer <pierre@ning.com>