Language:
كتاب الأدب
78  
Good Manners and Form (Al-Adab)
(92)
Chapter: To indulge in poetry
(92)
بَابُ مَا يُكْرَهُ أَنْ يَكُونَ الْغَالِبُ عَلَى الإِنْسَانِ الشِّعْرُ حَتَّى يَصُدَّهُ عَنْ ذِكْرِ اللَّهِ وَالْعِلْمِ وَالْقُرْآنِ
Sahih al-Bukhari 6155

Narrated Abu Huraira:

Allah's Messenger (ﷺ); said, "It is better for anyone of you that the inside of his body be filled with pus which may consume his body, than it be filled with poetry."

حَدَّثَنَا عُمَرُ بْنُ حَفْصٍ، حَدَّثَنَا أَبِي، حَدَّثَنَا الأَعْمَشُ، قَالَ سَمِعْتُ أَبَا صَالِحٍ، عَنْ أَبِي هُرَيْرَةَ ـ رضى الله عنه ـ قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ لأَنْ يَمْتَلِئَ جَوْفُ رَجُلٍ قَيْحًا يَرِيهِ خَيْرٌ مِنْ أَنْ يَمْتَلِئَ شِعْرًا ‏"‏‏.‏
Reference : Sahih al-Bukhari 6155
In-book reference : Book 78, Hadith 181
USC-MSA web (English) reference : Vol. 8, Book 73, Hadith 176
  (deprecated numbering scheme)