Filtering packets based on filter expression