Sahih al-Bukhari 1883
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
الْمَدِينَةُ كَالْكِيرِ، تَنْفِي خَبَثَهَا، وَيَنْصَعُ طَيِّبُهَا "
Narrated Jabir:
A bedouin came to the Prophet (ﷺ) and gave a pledge of allegiance for embracing Islam. The next day he came with fever and said (to the Prophet (ﷺ) ), "Please cancel my pledge (of embracing Islam and of emigrating to Medina)." The Prophet (ﷺ) refused (that request) three times and said, "Medina is like a furnace, it expels out the impurities (bad persons) and selects the good ones and makes them perfect."
Full reference and source
Sahih al-Bukhari 1883 In-book : Book 29, Hadith 17 USC-MSA web (English) : Vol. 3, Book 30, Hadith 107 (deprecated)
View source on Sunnah.com (opens in a new tab)