Narrated Ubai bin Ka’ab: Allah’s Messenger, peace be upon him, said, “Some poetry contains wisdom.”
[8: 166- O.B. Sahih Al-Bukhari]

Narrated Ibn Omar: The Prophet, peace be upon him, said, “It is better for a man to fill the inside of his body with pus than to fill it with poetry.”
[8: 175- O.B. Sahih Al-Bukhari)