I heard the Prophet ﷺ say, "Whoever keeps a dog that is of no use to him for guarding crops or livestock, a qirat will be deducted from his deeds each day."It was said to him, "Did you yourself hear this from the Prophet ﷺ?"He replied, "Yes, by the Lord of this mosque."
حدثنا أبو بكر بن أبي شيبة حدثنا خالد بن مخلد حدثنا مالك بن أنس عن يزيد بن خصيفة عن السائب بن يزيد
سمعت النبي ﷺ يقول من اقتنى كلبا لا يغني عنه زرعا ولا ضرعا نقص من عمله كل يوم قيراط فقيل له أنت سمعت من النبي ﷺ قال إي ورب هذا المسجد
Bukhari narrated it in the Book of Cultivation of Land and Sharecropping, chapter on keeping a dog for cultivation, hadith 2323, and elsewhere, hadith 61/1576, and Muslim in the Book of Sharecropping, chapter on the command to kill dogs and the account of its abrogation, both from the hadith of Malik. It is also found in the Muwatta (narration of Yahya), 3/969.