Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
suyuti:420-518bRabbih
Request/Fix translation

  

السيوطي:٤٢٠-٥١٨b

"شَكَى (شَكَا) نَبِىٌّ مِنَ الأَنْبِياء إِلَى رَبِّهِ فَقَالَ: يَا رَبِّ يَكُونُ الْعَبْدُ منْ عَبيدكَ يَكْفُرُ بكَ، وَيَعْمَلُ بِمَعَاصِيكَ فَتَزْوِى عَنْهُ الْبَلاءَ وَتَعْرِضُ لَهُ الدُّنْيا، فَأَوْحَى الله إِلَيْهِ: إِنَّ الْعبَادَ وَالْبَلاء لِى وِإنَّهُ لَيْسَ مِنْ شَىْءٍ إِلا وَهُوَ يُسَبِّحُنِى وَيُهَلِّلُنِى وَيُكَبِّرُنِى، فَأَمَّا عَبْدى الْمُؤْمِنُ فَلَهُ سَيّئَاتٌ فَأَزْوى عَنْهُ الدُّنْيَا وَأَعْرِضُ لَهُ الْبَلاءَ حَتَّى يَأتيَنِى فَأَجِزِيَهُ بِحَسَنَاتِه، وَأَمَّا عَبْدِى الْكَافرُ فَلَهُ حَسَنَاتٌ فَأَزْوى عَنْهُ الْبَلاءَ وَأعْرِضُ لَهُ الدُّنْيَا حَتَّى يَأتِيَنِى فَأَجْزيَهُ بِسيِّئَاتِهِ".  

[طب] الطبرانى في الكبير [حل] أبى نعيم في الحلية

See similar narrations below:

Collected by Ṭabarānī
tabarani:12735Aḥmad b. Muḥammad b. Dāwud al-Sukkarī al-Jundīsābūrī

[Machine] The Messenger of Allah ﷺ said: A prophet complained to his Lord saying, "O Lord, a slave among Your slaves believes in You and acts in obedience to You, so You shield him from this worldly life and afflict him with calamities. And another slave among Your slaves disbelieves in You and acts in disobedience to You, so You shield him from calamities and grant him from the worldly life." So Allah, the Exalted, revealed to him, "The afflictions are for Me and the worshipers are for Me. There is nothing except that it glorifies Me, declares My greatness, and proclaims My oneness. As for My believing servant, he has sins, so I shield him from this worldly life and afflict him with calamities until he comes to Me, and I reward him for his good deeds. As for My disbelieving servant, he has good deeds, so I shield him from calamities and grant him from this worldly life until he comes to Me, and I reward him for his sins."  

الطبراني:١٢٧٣٥حَدَّثَنَا أَحْمَدُ بْنُ مُحَمَّدِ بْنِ دَاوُدَ السُّكَّرِيُّ الْجُنْدِيسَابُورِيُّ ثنا مُحَمَّدُ بْنُ خُلَيْدٍ الْحَنَفِيُّ ثنا فُضَيْلُ بْنُ عِيَاضٍ عَنِ الْأَعْمَشِ عَنِ الْمِنْهَالِ بْنِ عَمْرٍو عَنْ سَعِيدِ بْنِ جُبَيْرٍ عَنْ عَبْدِ اللهِ بْنِ الْحَارِثِ عَنِ ابْنِ عَبَّاسٍ قَالَ

قَالَ رَسُولُ اللهِ ﷺ شَكَى نَبِيٌّ مِنَ الْأَنْبِيَاءِ إِلَى رَبِّهِ ﷻ قَالَ يَا رَبِّ يَكُونُ الْعَبْدُ مِنْ عَبِيدِكَ يُؤْمِنُ بِكَ وَيَعْمَلُ بِطَاعَتِكَ فَتُزْوِي عَنْهُ الدُّنْيَا وَتَعْرِضُ لَهُ الْبَلَاءَ وَيَكُونُ الْعَبْدُ مِنْ عَبِيدِكَ يَكْفُرُ بِكَ وَيَعْمَلُ بِمَعَاصِيكَ فَتُزْوِي عَنْهُ الْبَلَاءَ وَتَعْرِضُ لَهُ الدُّنْيَا فَأَوْحَى الله ﷻ إِلَيْهِ أَنَّ الْبَلَاءَ وَالْعِبَادَ لِي وَأَنَّهُ لَيْسَ مِنْ شَيْءٍ إِلَّا يُسَبِّحُنِي وَيُهَلِّلُنِي وَيُكَبِّرُنِي وَأَمَّا عَبْدِي الْمُؤْمِنُ فَلَهُ سَيِّئَاتٌ فَأَزْوِي عَنْهُ الدُّنْيَا وَأَعْرِضُ لَهُ الْبَلَاءَ حَتَّى يَأْتِيَنِي فَأَجْزِيهِ بِحَسَنَاتٍ وَأَمَّا عَبْدِيَ الْكَافِرُ فَلَهُ حَسَنَاتٌ فَأَزْوِي عَنْهُ الْبَلَاءَ وَأَعْرِضُ لَهُ الدُّنْيَا حَتَّى يَأْتِيَنِي فَأَجْزِيهِ بِسَيِّئَاتِهِ