Recently, Internet of Things (IoT) devices have developed at a faster rate and utilization of devices gets considerably increased in day to day lives. Despite the benefits of IoT devices, security issues remain challenging owing to the fact that most devices do not include memory and computing resources essential for satisfactory security operation. Consequently, IoT devices are vulnerable to different kinds of attacks. A single attack on networking system/device could result in considerable data to data security and privacy. But the emergence of artificial intelligence (AI) techniques can be exploited for attack detection and classification in the IoT environment. In this view, this paper presents novel metaheuristics feature selection with fuzzy logic enabled intrusion detection system (MFSFL-IDS) in the IoT environment. The presented MFSFL-IDS approach purposes for recognizing the existence of intrusions and accomplish security in the IoT environment. To achieve this, the MFSFL-IDS model employs data pre-processing to transform the data into useful format. Besides, henry gas solubility optimization (HGSO) algorithm is applied as a feature selection approach to derive useful feature vectors. Moreover, adaptive neuro fuzzy inference system (ANFIS) technique was utilized for the recognition and classification of intrusions in the network. Finally, binary bat algorithm (BBA) is exploited for adjusting parameters involved in the ANFIS model. A comprehensive experimental validation of the MFSFL-IDS model is carried out using benchmark dataset and the outcomes are assessed under distinct aspects. The experimentation outcomes highlighted the superior performance of the MFSFL-IDS model over recent approaches with maximum accuracy of 99.80%.