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.
tabarani:8847ʿAlī b. ʿAbd al-ʿAzīz > Ḥajjāj b. al-Minhāl > Ḥammād b. Salamah > Khālid al-Ḥadhhāʾ > Abū Qilābah > Ibn Masʿūd

[Machine] He used to say, "O Allah, if You have written me among the people of misery, then test me, and if You have written me among the people of happiness, then establish me."  

الطبراني:٨٨٤٧حَدَّثَنَا عَلِيُّ بْنُ عَبْدِ الْعَزِيزِ ثنا حَجَّاجُ بْنُ الْمِنْهَالِ ثنا حَمَّادُ بْنُ سَلَمَةَ عَنْ خَالِدٍ الْحَذَّاءِ عَنْ أَبِي قِلَابَةَ عَنِ ابْنِ مَسْعُودٍ ؓ

أَنَّهُ كَانَ يَقُولُ «اللهُمَّ إِنْ كُنْتَ كَتَبْتَنِي فِي أَهْلِ الشَّقَاءِ فَامْحُنِي وَاثْبُتْنِي فِي أَهْلِ السَّعَادَةِ»