script for filtering events.