Chabbisodhanasutta

Suttapiṭaka · Majjhimanikāya · Vol. 14 · Section 173

[173] Endowed with this noble aggregate of virtue (sīlakkhandha), I experienced within myself a blameless happiness. On seeing a form with the eye, I did not grasp at its sign (nimitta) nor grasp at its secondary features (anubyañjana); since, by dwelling with the eye faculty (cakkhundriya) unrestrained, evil unwholesome states of covetousness and grief (abhijjhā-domanassa) might flow in upon one, I practised for its restraint; I guarded the eye faculty; I attained restraint (saṃvara) with regard to the eye faculty. On hearing a sound with the ear … on smelling an odour with the nose … on tasting a flavour with the tongue … on touching a tangible with the body … on cognizing a mind-object with the mind, I did not grasp at its sign nor grasp at its secondary features; since, by dwelling with the mind faculty (manindriya) unrestrained, evil unwholesome states of covetousness and grief might flow in upon one, I practised for its restraint; I guarded the mind faculty; I attained restraint with regard to the mind faculty.

English translation from the Pali (Siam Raṭṭha edition) — under review, not for citation.

This passage also appears in 1 other place