Ubayy bin Kaab reported,

The Messenger of Allah ﷺ said, "Indeed, some poetry contains wisdom."

Azami 12944

Sahih

عن أبي بن كعب

أن رسول الله ﷺ قال: إن من الشعر حكمة.

الأعظمي 12944صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Tafsir of Surah Shuara
Section
From Abu Saeed Khudri who said, "While we were traveling with the Messenger of Allah ﷺ at Arj, a poet appeared reciting poetry. The Messenger of Allah ﷺ said, 'Seize the devil' or 'Hold the devil.' For a man's belly to be filled with pus is better for him than to be filled with poetry"
Numbering
Jami al-Kamil 12944 (2nd edition)
Azami 12944