Al-Adab Al-Mufrad, Book 39, Hadith 1 (In-Book)

Zayd ibn Khalid al-Juhani said, "The Messenger of Allah, may Allah bless him and grant him peace, led us in the Subh prayer at Hudaybiyya after it had rained on us during the night. When he finished, he faced the people and said, 'Do you know what your Lord has said?' They replied, 'Allah and His Messenger know best.' He said, 'This morning My slaves have become divided up into believers and unbelievers. Those who said, "We had rain by the favour and mercy of Allah," believe in Me and reject the stars. Those who said that it was because of a certain star, disbelieve in Me and believe in the stars."'"

حَدَّثَنَا إِسْمَاعِيلُ قَالَ‏:‏ حَدَّثَنِي مَالِكٌ، عَنْ صَالِحِ بْنِ كَيْسَانَ، عَنْ عُبَيْدِ اللهِ بْنِ عَبْدِ اللهِ بْنِ عُتْبَةَ بْنِ مَسْعُودٍ، عَنْ زَيْدِ بْنِ خَالِدٍ الْجُهَنِيِّ، أَنَّهُ قَالَ‏:‏ صَلَّى لَنَا رَسُولُ اللهِ صلى الله عليه وسلم صَلاَةَ الصُّبْحِ بِالْحُدَيْبِيَةِ عَلَى أَثَرِ سَمَاءٍ كَانَتْ مِنَ اللَّيْلَةِ، فَلَمَّا انْصَرَفَ النَّبِيُّ صلى الله عليه وسلم أَقْبَلَ عَلَى النَّاسِ فَقَالَ‏:‏ هَلْ تَدْرُونَ مَاذَا قَالَ رَبُّكُمْ‏؟‏ قَالُوا‏:‏ اللَّهُ وَرَسُولُهُ أَعْلَمُ، قَالَ‏:‏ أَصْبَحَ مِنْ عِبَادِي مُؤْمِنٌ بِي وَكَافِرٌ، فَأَمَّا مَنْ قَالَ‏:‏ مُطِرْنَا بِفَضْلِ اللهِ وَرَحْمَتِهِ، فَذَلِكَ مُؤْمِنٌ بِي كَافِرٌ بِالْكَوْكَبِ، وَأَمَّا مَنْ قَالَ‏:‏ بِنَوْءِ كَذَا وَكَذَا، فَذَلِكَ كَافِرٌ بِي، مُؤْمِنٌ بِالْكَوْكَبِ‏.‏

sunnah.com