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.
abudawud:476Abū Kāmil > Yazīd / Ibn Zurayʿ > Saʿīd > Qatādah > Anas b. Mālik

The Messenger of Allah ﷺ said: Spitting phlegm in the mosque... The narrator then transmitted the rest of the tradition to the same effect.  

أبو داود:٤٧٦حَدَّثَنَا أَبُو كَامِلٍ حَدَّثَنَا يَزِيدُ يَعْنِي ابْنَ زُرَيْعٍ عَنْ سَعِيدٍ عَنْ قَتَادَةَ عَنْ أَنَسِ بْنِ مَالِكٍ قَالَ

قَالَ رَسُولُ اللَّهِ ﷺ النُّخَاعَةُ فِي الْمَسْجِدِ فَذَكَرَ مِثْلَهُ