Add inspect filter

Originally for #2814, cleans up #2850.