Jami` at-Tirmidhi, Book 43, Hadith 119 (Tirmidhi 2924)

Narrated Ibn 'Abbas:

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