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:6245

[Machine] The Messenger of Allah ﷺ was in a red dome when a man on a disobedient horse came to him, followed by its reins. The man asked, "Who are you?" He replied, "I am the Messenger of Allah." The man asked, "When is the Hour?" He replied, "The knowledge of the Hour is with Allah alone." The man asked, "When will it rain?" He replied, "The knowledge of rainfall is with Allah alone." The man asked, "What is inside my horse's stomach?" He replied, "The knowledge of what is hidden is with Allah alone." The man said, "Give me your sword then." He replied, "Here it is." The man took the sword and pointed it towards him, then the Messenger of Allah ﷺ said, "You will not be able to do what you intend." And then he said, "This one (sword) has come forward and said, 'Give it to him, and then I will ask him and take my sword back and kill him.' So, he (the sword) was sheathed."  

الطبراني:٦٢٤٥وَبِإِسْنَادِهِ قَالَ

كَانَ رَسُولُ اللهِ ﷺ فِي قُبَّةٍ حَمْرَاءَ إِذْ جَاءَهُ رَجُلٌ عَلَى فَرَسٍ عَقُوقٍ يَتْبَعُهَا مُهْرُهُ فَقَالَ مَنْ أَنْتَ؟ قَالَ «أَنَا رَسُولُ اللهِ» قَالَ مَتَى السَّاعَةُ؟ قَالَ «غَيْبٌ وَلَا يَعْلَمُ الْغَيْبَ إِلَّا اللهُ» قَالَ فَمَتَى نُمْطَرُ؟ قَالَ «غَيْبٌ وَلَا يَعْلَمُ الْغَيْبَ إِلَّا اللهُ» قَالَ فَمَا فِي بَطْنِ فَرَسِي؟ قَالَ «غَيْبٌ وَلَا يَعْلَمُ الْغَيْبَ إِلَّا اللهُ» قَالَ فَأَعْطِنِي سَيْفَكَ؟ قَالَ «هَا» فَأَخَذَهُ فَسَلَّهُ ثُمَّ هَذَّهُ فَقَالَ رَسُولُ اللهِ ﷺ «إِنَّكَ لَنْ تَسْتَطِيعَ الَّذِي أَرَدْتَ» ثُمَّ قَالَ «إِنَّ هَذَا أَقْبَلَ فَقَالَ آتِيهِ فَأَسْأَلُهُ ثُمَّ آخُذُ سَيْفِي فَأَقْتُلُهُ» فَغَمَدَ السَّيْفَ  


See similar narrations below:

Collected by Ḥākim
hakim:14Abū al-Ḥasan Muḥammad b. ʿAbdullāh al-Jawharī > Muḥammad b. Isḥāq > Aḥmad b. Yūsuf > al-Naḍr b. Muḥammad > ʿIkrimah b. ʿAmmār > Iyās b. Salamah from my father

[Machine] He was with the Messenger of Allah ﷺ when a man came to him with a horse that he was riding and a mare following him. He asked him, "Who are you?" He said, "I am a prophet." He asked, "What kind of prophet?" He said, "The Messenger of Allah." He asked, "When will the Hour (Day of Judgment) be established?" The Messenger of Allah ﷺ said, "It is knowledge that is only with Allah and no one knows about it except Him." He said, "Show me your sword." So the Prophet ﷺ gave him his sword. The man shook it and then returned it to him. The Messenger of Allah ﷺ said, "Indeed, you were not able to do what you wanted to." He said, "And he (the Prophet) had said to him, 'Go to him and ask him about these characteristics.'"  

الحاكم:١٤أَخْبَرَنِي أَبُو الْحَسَنِ مُحَمَّدُ بْنُ عَبْدِ اللَّهِ الْجَوْهَرِيُّ حَدَّثَنَا مُحَمَّدُ بْنُ إِسْحَاقَ حَدَّثَنَا أَحْمَدُ بْنُ يُوسُفَ حَدَّثَنَا النَّضْرُ بْنُ مُحَمَّدٍ حَدَّثَنَا عِكْرِمَةُ بْنُ عَمَّارٍ حَدَّثَنَا إِيَاسُ بْنُ سَلَمَةَ حَدَّثَنِي أَبِي

أَنَّهُ كَانَ مَعَ رَسُولِ اللَّهِ ﷺ إِذْ جَاءَهُ رَجُلٌ بِفَرَسٍ لَهُ يَقُودُهَا عَقُوقٍ وَمَعَهَا مُهْرَةٌ لَهَا يَتْبَعُهَا فَقَالَ مَنْ أَنْتَ؟ فَقَالَ «أَنَا نَبِيٌّ» قَالَ مَا نَبِيٌّ؟ قَالَ «رَسُولُ اللَّهِ» قَالَ مَتَى تَقُومُ السَّاعَةُ؟ فَقَالَ رَسُولُ اللَّهِ ﷺ «غَيْبٌ وَلَا يَعْلَمُ الْغَيْبَ إِلَّا اللَّهُ» قَالَ أَرِنِي سَيْفَكَ فَأَعْطَاهُ النَّبِيُّ ﷺ سَيْفَهُ فَهَزَّهُ الرَّجُلُ ثُمَّ رَدَّهُ عَلَيْهِ فَقَالَ رَسُولُ اللَّهِ ﷺ «أَمَا إِنَّكَ لَمْ تَكُنْ تَسْتَطِيعُ الَّذِي أَرَدْتَ» قَالَ وَقَدْ كَانَ قَالَ اذْهَبْ إِلَيْهِ فَسَلْهُ عَنْ هَذِهِ الْخِصَالِ  

«هَذَا حَدِيثٌ صَحِيحٌ وَلَمْ يُخَرِّجَاهُ وَقَدِ اتَّفَقَا جَمِيعًا عَلَى الْحُجَّةِ بإيَاسِ بْنِ سَلَمَةَ عَنْ أَبِيهِ وَاحْتَجَّ مُسْلِمٌ بِهَذَا الْإِسْنَادِ بِعَيْنِهِ فَحَدَّثَ عَنْ أَحْمَدَ بْنِ يُوسُفَ بِغَيْرِ حَدِيثٍ» على شرط مسلم