A man came to the Messenger of Allah ﷺ and said, "Messenger of Allah, the livestock have perished and the roads have been cut off, so pray to Allah ."The Messenger of Allah ﷺ prayed, and we were given rain from one Friday to the next.Then a man came to the Messenger of Allah ﷺ and said, "Messenger of Allah, the houses have collapsed, the roads have been cut off, and the livestock have perished."He said, "O Allah, upon the mountaintops, the hills, the valley bottoms, and the places where trees grow."The clouds then parted from Medina the way a garment is parted.
أخبرنا قتيبة بن سعيد عن مالك عن شريك بن عبد الله بن أبي نمر
جاء رجل إلى رسول الله ﷺ فقال يا رسول الله هلكت المواشي وانقطعت السبل فادع الله عز وجل فدعا رسول الله ﷺ فمطرنا من الجمعة إلى الجمعة فجاء رجل إلى رسول الله ﷺ فقال يا رسول الله تهدمت البيوت وانقطعت السبل وهلكت المواشي فقال اللهم على رءوس الجبال والآكام وبطون الأودية ومنابت الشجر فانجابت عن المدينة انجياب الثوب
Bukhari transmitted it in the book of seeking rain, chapter on the supplication when roads are cut off due to heavy rain, hadith 1077, from the hadith of Malik. Muslim transmitted it in the book of the prayer for seeking rain, chapter on the supplication for seeking rain, hadith 897, from the hadith of Sharik, with the same wording. It is also found in Muwatta (Yahya), 1/191, and in Kubra, hadith 1805.