Jami` at-Tirmidhi, Hadith 1327 ⓘ
Some men who were companions of Mu'adh narrated from Mu'adh that the Messenger of Allah sent Mu'adh to Yemen, so he said: "How will you judge?" He said: "I will judge according to what is in Allah's Book." He said: "If it is not in Allah's Book ?" He said: "Then with the Sunnah of the Messenger of Allah." He said: "If it is not in the Sunnah of Messenger of Allah?" He said: "I will give in my view." He said: "All praise is due to Allah, the One Who made the messenger of the Messenger of Allah suitable."
حَدَّثَنَا هَنَّادٌ، حَدَّثَنَا وَكِيعٌ، عَنْ شُعْبَةَ، عَنْ أَبِي عَوْنٍ الثَّقَفِيِّ، عَنِ الْحَارِثِ بْنِ عَمْرٍو، عَنْ رِجَالٍ، مِنْ أَصْحَابِ مُعَاذٍ عَنْ مُعَاذٍ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم بَعَثَ مُعَاذًا إِلَى الْيَمَنِ فَقَالَ " كَيْفَ تَقْضِي " . فَقَالَ أَقْضِي بِمَا فِي كِتَابِ اللَّهِ . قَالَ " فَإِنْ لَمْ يَكُنْ فِي كِتَابِ اللَّهِ " . قَالَ فَبِسُنَّةِ رَسُولِ اللَّهِ صلى الله عليه وسلم . قَالَ " فَإِنْ لَمْ يَكُنْ فِي سُنَّةِ رَسُولِ اللَّهِ صلى الله عليه وسلم " . قَالَ أَجْتَهِدُ رَأْيِي . قَالَ " الْحَمْدُ لِلَّهِ الَّذِي وَفَّقَ رَسُولَ رَسُولِ اللَّهِ صلى الله عليه وسلم " .
also referenced under: Book 15, Hadith 7 (In-Book) & Volume 3, Book 13, Hadith 1327 (DarusSalam)