Where do you find brain on Subaru Legacy?
I wouldn't jump to the most expensive part first. Have you checked the coil, or distributor?
As Reelin says, check the coil pack first. The ECU is under the passenger side foot panel where the gas/brake/clutch pedals would be on that side.
Search Subaru Legacy Questions
Are you a UK consumer? CarGurus now has a discussion forum in the UK.
Subaru Legacy Experts