The Messenger of Allah ﷺ said, "Whoever keeps a dog, except a dog for hunting, farming, or guarding livestock, will have a qirat deducted from his reward each day."
أخبرنا إسحق بن إبراهيم قال أنبأنا عبد الرزاق قال حدثنا معمر عن الزهري عن أبي سلمة
عن رسول الله ﷺ قال من اتخذ كلبا إلا كلب صيد أو زرع أو ماشية نقص من عمله كل يوم قيراط
Muslim narrated it, hadith no. 1575. See the earlier hadith no. 4292, from the hadith of Abdul-Razzaq, with the same wording. It is also found in Kubra, hadith no. 4800.