simplify log query