The Messenger of Allah ﷺ said, "Whoever keeps a dog, other than a dog for guarding livestock or a hunting dog, will have one qirat deducted from his good deeds each day."Abdullah said, "Abu Hurairah added, 'or a dog for guarding crops.'"
أخبرنا علي بن حجر قال حدثنا إسمعيل يعني ابن جعفر قال حدثنا محمد بن أبي حرملة
قال رسول الله ﷺ من اقتنى كلبا إلا كلب ماشية أو كلب صيد نقص من عمله كل يوم قيراط قال عبد الله وقال أبو هريرة أو كلب حرث
Muslim reported it, no. 53/1574, from Ali bin Hajar through the same chain. See the earlier hadith no. 4292. It is also in Kubra, no. 4802.