Hadithcore
Sahih al-Bukhari, 6167
sahih

Narrated Anas:

A bedouin came to the Prophet (ﷺ) and said, "O Allah's Messenger (ﷺ) ! When will The Hour be established?" The Prophet (ﷺ) said, "Wailaka (Woe to you), What have you prepared for it?" The bedouin said, "I have not prepared anything for it, except that I love Allah and H is Messenger." The Prophet (ﷺ) said, "You will be with those whom you love." We (the companions of the Prophet (ﷺ) ) said, "And will we too be so? The Prophet (ﷺ) said, "Yes." So we became very glad on that day. In the meantime, a slave of Al-Mughira passed by, and he was of the same age as I was. The Prophet (ﷺ) said. "If this (slave) should live long, he will not reach the geriatric old age, but the Hour will be established."

حَدَّثَنَا عَمْرُو بْنُ عَاصِمٍ، حَدَّثَنَا هَمَّامٌ، عَنْ قَتَادَةَ، عَنْ أَنَسٍ، أَنَّ رَجُلاً، مِنْ أَهْلِ الْبَادِيَةِ أَتَى النَّبِيَّ صلى الله عليه وسلم فَقَالَ يَا رَسُولَ اللَّهِ مَتَى السَّاعَةُ قَائِمَةٌ قَالَ ‏"‏ وَيْلَكَ وَمَا أَعْدَدْتَ لَهَا ‏"‏‏.‏ قَالَ مَا أَعْدَدْتُ لَهَا إِلاَّ أَنِّي أُحِبُّ اللَّهَ وَرَسُولَهُ‏.‏ قَالَ ‏"‏ إِنَّكَ مَعَ مَنْ أَحْبَبْتَ ‏"‏‏.‏ فَقُلْنَا وَنَحْنُ كَذَلِكَ‏.‏ قَالَ ‏"‏ نَعَمْ ‏"‏‏.‏ فَفَرِحْنَا يَوْمَئِذٍ فَرَحًا شَدِيدًا، فَمَرَّ غُلاَمٌ لِلْمُغِيرَةِ وَكَانَ مِنْ أَقْرَانِي فَقَالَ ‏"‏ إِنْ أُخِّرَ هَذَا فَلَنْ يُدْرِكَهُ الْهَرَمُ حَتَّى تَقُومَ السَّاعَةُ ‏"‏‏.‏ وَاخْتَصَرَهُ شُعْبَةُ عَنْ قَتَادَةَ سَمِعْتُ أَنَسًا عَنِ النَّبِيِّ صلى الله عليه وسلم‏.‏

References2 variants
In-Book Reference
Book 78, Hadith 193
USC-MSA web (English) reference
Vol. 8, Book 73, Hadith 188 (deprecated numbering scheme)