Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
nasai:665Isḥāq b. Manṣūr > ʿAbd al-Raḥman > Shuʿbah > al-Ḥakam > Ibn Abū Laylá > ʿAbdullāh b. Rubayyiʿah

"This is a shepherd or a man who is away from his family." So they looked and so it was a shepherd.  

النسائي:٦٦٥أَخْبَرَنَا إِسْحَاقُ بْنُ مَنْصُورٍ قَالَ أَنْبَأَنَا عَبْدُ الرَّحْمَنِ عَنْ شُعْبَةَ عَنِ الْحَكَمِ عَنِ ابْنِ أَبِي لَيْلَى عَنْ عَبْدِ اللَّهِ بْنِ رُبَيِّعَةَ

أَنَّهُ كَانَ مَعَ رَسُولِ اللَّهِ ﷺ فِي سَفَرٍ فَسَمِعَ صَوْتَ رَجُلٍ يُؤَذِّنُ فَقَالَ مِثْلَ قَوْلِهِ ثُمَّ قَالَ إِنَّ هَذَا لَرَاعِي غَنَمٍ أَوْ عَازِبٌ عَنْ أَهْلِهِ فَنَظَرُوا فَإِذَا هُوَ رَاعِي غَنَمٍ