Script for filtering logs