Updated get logs query