SOmething like this worked for me.
Lookup search
index=_internal earliest=-1d@d latest=@d| stats count as past by sourcetype | outputlookup internalsourcetypepast.csv
Delete search
index=_internal earliest=@d| lookup internalsourcetypepast.csv sourcetype | where past<100 | delete
Hm, today it works for me as well. Thanks 🙂