log slicing script