2000 Subaru outback stalling

I have a 2000 Subaru outback (150,000 miles). Recently after starting, the car will feel sluggish or like it’s pulling. When I come to a complete stop it will shake and feel like it’s about to shut off… and recently it has been shutting off. Last night I changed the spark plugs, spark plug wires, and fuel filter… after that the car was driving worse. My check engine light is on and the code is for a knock sensor. Also there was oil on my spark plugs which I believe is an idication that there is a broken or leaky gasket. I am at a loss… would the leaky or broken gasket cause car the run sluggish and stall, would a faulty knock sensor cause the the same? I also need to get my rotors changed but I don’t think that would cause any of this. Any help greatly appreciated… and it just happens to be Murphy’s Law, that I just paid off the car :frowning:
Thanks for your help!!

Was the spark plug tube filled with fresh oil?

That would be a sign that the spark plug tube seals have failed.

The cylinder with the fouled plug was most likely misfiring, and that would cause the car to run sluggish, have lower power, etc.

First things first, fix the CEL. Those knock sensors are prone to failure and the fix is to simply replace them. The part should be around $85 from the dealership (probably cheaper elsewhere) and is very simple to replace, even for the novice wrencher. Just remove the intake airbox, unplug the connection, and unbolt the sensor. Here’s the location: http://www.porcupine73.com/pics/sensors/knocksensor3.jpg

I just had a similar issue with my 2002 OB, with 198,000 miles. The dealer said at first that it was gasket seals and that it would cost $2,000 to fix. I took the car to 2 different independent mechanics who both disagreed with the dealer. It turns out that the problem was just an oxygen sensor.
The car lurched and bucked at city or highway speed and occasionally stalled at stop signs & in parking lots and even backfired on occasion.
Now everything is all good again.