Abdullah b. Umar reported
The Messenger of Allah (ﷺ) saw spittle on the wall towards Qibla, and scratched it away and then turning to the people said: When any one of you prays, he must not spit in front of him, for Allah is in front of him when he is engaged in prayer.
Ibn Umar reported that the Messenger of Allah (ﷺ) saw sputum sticking to the Qibla wall of the mosque, the rest of the hadith is the same.
Abu Sa'id al-Khudri reported
The Apostle of Allah (ﷺ) saw sputum sticking to the Qibla of the mosque. He scratched it off with a pebble and then forbade spitting on the right side or in front, but (it is permissible) to spit on the left side or under the left foot.
Abu Huraira and Abu Sa'id narrated that the Messenger of Allah (ﷺ) saw sputum, and the rest of the hadith is the same.
'A'isha reported
The Apostle of Allah (may, peace be upon him) saw spittle or snot or sputum, sticking to the wall towards Qibla and scratched it off.
Abu Huraira reported that the Messenger of Allah (ﷺ) saw some sputum in the direction of the Qibla of the mosque. He turned towards people and said
How Is it that someone amongst you stands before his Lord and then spits out in front of Him? Does any one of you like that he should be made to stand in front of someone and then spit at his face? So when any one of you spits, he must spit on his left side under his foot. But if he does not find (space to spit) he should do like this. Qasim (one of the narrators) spat in his cloth and then folded it and rubbed it.
Abu Huraira reported
I perceive as if I am looking at the Messenger of Allah (ﷺ) folding up a part of his cloth with another one.
Anas b. Malik reported
The Messenger of Allah (ﷺ) said: When any one of you is engaged in prayer, he is holding intimate conversation with his Lord, so none of you must spit in front of him, or towards his right side, but towards his left side under his foot.
Anas b. Malik reported
The Messenger of Allah (ﷺ) said: Spitting in a mosque is a sin, and its expiation is that it should be buried.
Shu'ba reported
I asked Qatada about spitting, in the mosque. He said: I heard Anas b. Malik say: I heard the Messenger of Allah (ﷺ) say: Spitting in the mosque is a sin, and its expiation is that it should be buried.
Abu Dharr reported
The Apostle of Allah (ﷺ) said: The deeds of my people, good and bad, were presented before me, and I found the removal of something objectionable from the road among their good deeds, and the sputum mucus left unburied in the mosque among their evil deeds.
Abdullah b. Shakhkhir reported on the authority of his father that he said
I said prayer with the Messenger of Allah (ﷺ) and saw him spitting and rubbing it off with his shoe.
'Abdullah b. Shakhkhir narrated it on the authority of his father that he said prayer with the Messenger of Allah (ﷺ), and he spat and then rubbed it off with his left shoe.