When do you change the knock sensor on Subaru?

When is sends a code to the ECM that it is malfunctioning. Usually a PO 325 but the codes are slightly different depending on the model and year. You can get a complete Subaru PO listing if you Google it. If there is no code, your knock sensor is fine.