A complaint was brought to the Prophet ﷺ about a man who senses something during prayer. He said, "He should not break his prayer unless he detects an odor or hears a sound."
حدثنا محمد بن الصباح قال أنبأنا سفيان بن عيينة عن الزهري
شكي إلى النبي ﷺ الرجل يجد الشيء في الصلاة فقال لا حتى يجد ريحا أو يسمع صوتا
Bukhari narrated it in the Book of Wudu, in the chapter "One does not perform wudu based on doubt until certain," hadith 137, and elsewhere, hadith 361, from the hadith of Ibn Uyayna. Muslim narrated it in the Book of Menstruation, in the chapter "The proof that one who is certain of purity..."