Anas bin Malik reported,

It is mentioned that on a Friday a man entered through a door that was facing the pulpit while the Messenger of Allah ﷺ was standing and delivering the sermon. He stood facing the Messenger of Allah ﷺ and said, "Messenger of Allah, the livestock have perished and the roads have been cut off, so pray to Allah to send us rain."The Messenger of Allah ﷺ raised his hands and said, "O Allah, give us rain. O Allah, give us rain. O Allah, give us rain."Anas said, "By Allah, we could not see any cloud in the sky, not a wisp, not a thing, and there was no house or building between us and Sal."Then a cloud appeared from behind the mountain like a shield, and when it reached the middle of the sky it spread out and began to pour rain. By Allah, we did not see the sun for six days.Then on the following Friday a man entered through that same door while the Messenger of Allah ﷺ was standing and delivering the sermon. He stood facing him and said, "Messenger of Allah, the property has been destroyed and the roads have been cut off, so pray to Allah to hold it back."The Messenger of Allah ﷺ raised his hands and said, "O Allah, around us and not upon us. O Allah, upon the hills, the mountains, the thickets, the small hillocks, the valleys, and the places where trees grow."Then it stopped, and we went out walking in the sunshine.Sharik said, I asked Anas bin Malik, "Was this the same man as the first one?"He replied, "I do not know."

Bukhari 1013

Sahih

حدثنا محمد قال أخبرنا أبو ضمرة أنس بن عياض قال حدثنا شريك بن عبد الله بن أبي نمر أنه سمع

أنس بن مالك

يذكر أن رجلا دخل يوم الجمعة من باب كان وجاه المنبر ورسول الله ﷺ قائم يخطب فاستقبل رسول الله ﷺ قائما فقال يا رسول الله هلكت المواشي وانقطعت السبل فادع الله يغيثنا قال فرفع رسول الله ﷺ يديه فقال اللهم اسقنا اللهم اسقنا اللهم اسقنا قال أنس ولا والله ما نرى في السماء من سحاب ولا قزعة ولا شيئا وما بيننا وبين سلع من بيت ولا دار قال فطلعت من ورائه سحابة مثل الترس فلما توسطت السماء انتشرت ثم أمطرت قال والله ما رأينا الشمس ستا ثم دخل رجل من ذلك الباب في الجمعة المقبلة ورسول الله ﷺ قائم يخطب فاستقبله قائما فقال يا رسول الله هلكت الأموال وانقطعت السبل فادع الله يمسكها قال فرفع رسول الله ﷺ يديه ثم قال اللهم حوالينا ولا علينا اللهم على الآكام والجبال والآجام والظراب والأودية ومنابت الشجر قال فانقطعت وخرجنا نمشي في الشمس قال شريك فسألت أنس بن مالك أهو الرجل الأول قال لا أدري

البخاري 1013صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Istisqa
Chapter
Praying for rain in the main masjid
Numbering
Darussalam 1013
Bukhari 1013