Jami` at-Tirmidhi, Book 43, Hadith 118 (Tirmidhi 2923)

Narrated 'Abdullah:

that the Messenger of Allah (ﷺ) said: "Indeed some poetry is wisdom"