Sahih Muslim #4542 · The Book of Jihad and Expeditions

Sahih MuslimIt is narrated by Abu Nadr that he learnt from a letter sent by a man from the Aslam tribe
Sahih Muslim · Book 32 · The Book of Jihad and Expeditions
Sahih Muslim · كتاب 32 · كتاب الجهاد والسير
O ye men, do not wish for an encounter with the enemy. Pray to Allah to grant you security; (but) when you (have to) encounter them exercise patience, and you should know that Paradise is under the shadows of the swords. Then the Messenger of Allah (ﷺ) stood up (again) and said: O Allah. Revealer of the Book, Disperser of the clouds, Defeater of the hordes, put our enemy to rout and help us against them.
وَحَدَّثَنِي مُحَمَّدُ بْنُ رَافِعٍ، حَدَّثَنَا عَبْدُ الرَّزَّاقِ، أَخْبَرَنَا ابْنُ جُرَيْجٍ، أَخْبَرَنِي مُوسَى، بْنُ عُقْبَةَ عَنْ أَبِي النَّضْرِ، عَنْ كِتَابِ، رَجُلٍ مِنْ أَسْلَمَ مِنْ أَصْحَابِ النَّبِيِّ صلى الله عليه وسلم يُقَالُ لَهُ عَبْدُ اللَّهِ بْنُ أَبِي أَوْفَى فَكَتَبَ إِلَى عُمَرَ بْنِ عُبَيْدِ اللَّهِ حِينَ سَارَ إِلَى الْحَرُورِيَّةِ يُخْبِرُهُ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم كَانَ فِي بَعْضِ أَيَّامِهِ الَّتِي لَقِيَ فِيهَا الْعَدُوَّ يَنْتَظِرُ حَتَّى إِذَا مَالَتِ الشَّمْسُ قَامَ فِيهِمْ فَقَالَ ‏
"‏ يَا أَيُّهَا النَّاسُ لاَ تَتَمَنَّوْا لِقَاءَ الْعَدُوِّ وَاسْأَلُوا اللَّهَ الْعَافِيَةَ فَإِذَا لَقِيتُمُوهُمْ فَاصْبِرُوا وَاعْلَمُوا أَنَّ الْجَنَّةَ تَحْتَ ظِلاَلِ السُّيُوفِ ‏"‏ ‏.‏ ثُمَّ قَامَ النَّبِيُّ صلى الله عليه وسلم وَقَالَ ‏"‏ اللَّهُمَّ مُنْزِلَ الْكِتَابِ وَمُجْرِيَ السَّحَابِ وَهَازِمَ الأَحْزَابِ اهْزِمْهُمْ وَانْصُرْنَا عَلَيْهِمْ ‏"‏ ‏.‏
Reference : Sahih Muslim 4542In-book reference : Book 32, Hadith 23