The funny thing is that quite often people who actually perform attacks are well known to the security services ( because they have been frequently referred to them - rather than some online trawl ).
cf UK manchester bombers.
In the end the only effective way to stop terrorism ( since it's so easy to just drive a car into a crowd of people ), is to create a society where people don't want to do it - which is what we mostly have - as terrorism, while terrible, is fortunately still quite rare.