Mishkat al-Masabih 182
Abu Huraira reported God’s messenger as saying, “The Qur’an came down showing five aspects:
what is permissible, what is prohibited, what is firmly fixed, what is obscure, and parables. So treat what is permissible as permissible and what is prohibited as prohibited, act upon what is firmly fixed; believe in what is obscure, and take a lesson from the parables.” 

This is the wording in Al-masabih . Baihaqi transmitted it in Shu’ab al-iman , his wording being, “Act according to what is permissible, avoid what is prohibited, and follow what is firmly fixed.”
وَعَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: 
" نَزَلَ الْقُرْآنُ عَلَى خَمْسَةِ أَوْجُهٍ: حَلَالٍ وَحَرَامٍ وَمُحْكَمٍ وَمُتَشَابِهٍ وَأَمْثَالٍ. فَأَحِلُّوا الْحَلَالَ وَحَرِّمُوا الْحَرَامَ وَاعْمَلُوا بِالْمُحْكَمِ وَآمِنُوا بِالْمُتَشَابِهِ وَاعْتَبِرُوا بِالْأَمْثَالِ ". هَذَا لَفْظَ الْمَصَابِيحِ. وَرَوَى الْبَيْهَقِيُّ فِي شُعَبِ الايمان وَلَفْظُهُ: «فَاعْمَلُوا بِالْحَلَالِ وَاجْتَنِبُوا الْحَرَامَ وَاتَّبِعُوا الْمُحْكَمَ»