(1) باب فَضَائِلِ أَصْحَابِ النَّبِيِّ صلى الله عليه وسلم
Narrated Abu Sa`id Al-Khudri:
"Allah's Messenger (ﷺ) said, "A time will come upon the people, when a group of people will wage a holy war and it will be said, 'Is there amongst you anyone who has accompanied Allah's Messenger (ﷺ)?' They will say, 'Yes.' And so victory will be bestowed on them. Then a time will come upon the people when a group of people will wage a holy war, and it will be said, "Is there amongst you anynone who has accompanied the companions of Allah's Messenger (ﷺ)?' They will say, 'Yes.' And so victory will be bestowed on them. Then a time will come upon the people when a group of people will wage a holy war, and it will be said, "Is there amongst you anyone who has been in the company of the companions of the companions of Allah's Messenger (ﷺ) ?' They will say, 'Yes.' And victory will be bestowed on them."
Reference: Sahih al-Bukhari 3649
In-book reference: Book 62, Hadith 1
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 5, Book 57, Hadith 1