Intermittent dashboard lights on 2001 Subaru Outback

Why would a check engine light come and go? When it's on it
checks out as a knock sensor. Also, the brake light is similar, but I can occasionly turn it off by using the handbrake. ....

Asked by for the 2001 Subaru Outback
the check engine light comes on whenever there is an engine management system failure. you can either repair that problem or you can ignore it.