Hadith 961:75
Waki’ narrated to us, Shu’bah narrated to us, from Abu ‘Awn al-Thaqafi, from al-Harith ibn ‘Amr, from men among the companions of Mu’adh, that when the Prophet, peace and blessings of Allah be upon him, sent him to Yemen, he said: "How will you judge?" He said: "I will judge by the Book of Allah." He said: "If it is not in the Book of Allah?" He said: "Then by the Sunnah of the Messenger of Allah, peace and blessings of Allah be upon him." He said: "If it is not in the Sunnah of the Messenger of Allah, peace and blessings of Allah be upon him?" He said: "I will exert my own opinion." He said: The Messenger of Allah, peace and blessings of Allah be upon him, then said: "Praise be to Allah who has granted success to the messenger of the Messenger of Allah."
حدثنا وكيع، حدثنا شعبة، عن أبي عون الثقفي، عن الحارث بن عمرو، عن رجال من أصحاب معاذ، أن النبي صلى الله عليه وسلم لما بعثه إلى اليمن فقال: " كيف تقضي؟ " قال: أقضي بكتاب الله. قال: " فإن لم يكن في كتاب الله ". قال: فبسنة رسول الله صلى الله عليه وسلم. قال: " فإن لم يكن في سنة رسول الله صلى الله عليه وسلم ". قال: أجتهد رأيي. قال: فقال رسول الله صلى الله عليه وسلم: " الحمد لله الذي وفق رسول رسول الله "