كتاب الجهاد والسير
32  
The Book of Jihad and Expeditions
(44)
Chapter: The Battle of Al-Ahzab (The Confederates), also known as Al-Khandaq (The Ditch)
(44)
باب غَزْوَةِ الأَحْزَابِ وَهِيَ الْخَنْدَقُ ‏‏
Sahih Muslim 1805 a

It has been narrated on the authority of Anas b. Malik that the Messenger of Allah (ﷺ) said:

O God, there is no life, but the life of the Hereafter, So forgive Thou the Ansar and the Muhajirs.
وَحَدَّثَنَا مُحَمَّدُ بْنُ الْمُثَنَّى، وَابْنُ، بَشَّارٍ - وَاللَّفْظُ لاِبْنِ الْمُثَنَّى - حَدَّثَنَا مُحَمَّدُ بْنُ، جَعْفَرٍ حَدَّثَنَا شُعْبَةُ، عَنْ مُعَاوِيَةَ بْنِ قُرَّةَ، عَنْ أَنَسِ بْنِ مَالِكٍ، عَنِ النَّبِيِّ صلى الله عليه وسلم أَنَّهُ قَالَ ‏ "‏ اللَّهُمَّ لاَ عَيْشَ إِلاَّ عَيْشُ الآخِرَهْ فَاغْفِرْ لِلأَنْصَارِ وَالْمُهَاجِرَهْ ‏"‏ ‏.‏
Reference : Sahih Muslim 1805a
In-book reference : Book 32, Hadith 155
USC-MSA web (English) reference : Book 19, Hadith 4445
  (deprecated numbering scheme)