كتاب الإمارة
33  
The Book on Government
(48)
Chapter: The reward of one who is kept from fighting by sickness or any other excuse
(48)
باب ثَوَابِ مَنْ حَبَسَهُ عَنِ الْغَزْوِ، مَرَضٌ أَوْ عُذْرٌ آخَرُ ‏‏
Sahih Muslim 1911 a

It has been narrated on the authority of Jabir who said:

We were with the Prophet (ﷺ) on an expedition. He said: There are some people in Medina. They are with you whenever you cover a distance or cross a valley. They have been detained by illness.
حَدَّثَنَا عُثْمَانُ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا جَرِيرٌ، عَنِ الأَعْمَشِ، عَنْ أَبِي سُفْيَانَ، عَنْ جَابِرٍ، قَالَ كُنَّا مَعَ النَّبِيِّ صلى الله عليه وسلم فِي غَزَاةٍ فَقَالَ ‏ "‏ إِنَّ بِالْمَدِينَةِ لَرِجَالاً مَا سِرْتُمْ مَسِيرًا وَلاَ قَطَعْتُمْ وَادِيًا إِلاَّ كَانُوا مَعَكُمْ حَبَسَهُمُ الْمَرَضُ ‏"‏ ‏.‏
Reference : Sahih Muslim 1911a
In-book reference : Book 33, Hadith 227
USC-MSA web (English) reference : Book 20, Hadith 4697
  (deprecated numbering scheme)