Yes, but filebeat has no ability to parse line against regexp (to extract filter field).
Look at Exported fields in filebeat processors
which suggests to use ingest instead of filebeat
I think it would be nice (and easy) to implement an ability to ignore a line in ingest depending on some condition (after parsing a line against regexp).