logging output and saving filtered rows