Hadithcore
Musnad Ahmad, 887
da’if· Darussalam

It was narrated from ‘Ali bin Abi Talib that the Prophet (ﷺ) said:

`The anus, for the eye [in another version of this report, it says, `The eye, for the anus…’ which sounds more apt], is like the string that ties up a waterskin; whoever goes to sleep, let him do wudoo’.”

حَدَّثَنَا عَلِيُّ بْنُ بَحْرٍ، حَدَّثَنَا بَقِيَّةُ بْنُ الْوَلِيدِ الْحِمْصِيُّ، حَدَّثَنِي الْوَضِينُ بْنُ عَطَاءٍ، عَنْ مَحْفُوظِ بْنِ عَلْقَمَةَ، عَنْ عَبْدِ الرَّحْمَنِ بْنِ عَائِذٍ الْأَزْدِيِّ، عَنْ عَلِيِّ بْنِ أَبِي طَالِبٍ، عَنْ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ إِنَّ السَّهَ وِكَاءُ الْعَيْنِ فَمَنْ نَامَ فَلْيَتَوَضَّأْ‏.‏

References1 variant
In-Book Reference
Book 5, Hadith 316