وَ إِنَّ مِنَ الشِّعْرِ لَحِکْمَةً وَاِنَّ مِنَ الْبَیَانِ لَسِحْرًا
Indeed, in poetry there is wisdom and in eloquence there is magic
The 19th of the 40 hadiths gathered by Shah Waliullah ad-Dehlawi in Shah Waliullah's Forty Hadith, given below in the original Arabic with an English translation and its reference.
وَ إِنَّ مِنَ الشِّعْرِ لَحِکْمَةً وَاِنَّ مِنَ الْبَیَانِ لَسِحْرًا
Indeed, in poetry there is wisdom and in eloquence there is magic
Sunni collections: text from the open hadith-api dataset. Al-Kafi: Arabic text, Muhammad Sarwar's translation and gradings from Thaqalayn.net via the Thaqalayn API. Hadith numbering follows those editions and can differ from a printed copy — check the Arabic against a trusted edition before relying on a reference.