Sayyiduna Abu Bakrah (may Allah be pleased with him) reports this saying of the Prophet (peace and blessings be upon him): "Indeed, some poetry is wisdom."
Al-Tabarani recorded it in al-Mu'jam al-Kabir and al-Mu'jam al-Awsat. Its chain contains al-Nadr bin Tahir, and he is a kadhdhab (liar).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الأدب / 13326