During the last decade the analysis of intrusion detection has become very significant, the researcher focuses on various dataset to improve system accuracy and to reduce false positive rate based on DAPRA 98 and later the updated version as KDD cup 99 dataset which shows some statistical issues, it degrades the evaluation of anomaly detection that affects the performance of the security analysis which leads to the replacement of KDD cup 99 to NSL-KDD dataset. This paper focus on detailed analysis on NSL- KDD dataset and proposed  a new technique of combining swarm intelligence (Simplified Swarm Optimization) and data mining algorithm (Random Forest) for feature selection and reduction. SSO is used to find more appropriate set of attributes for classifying network intrusions, and Random Forest is used as a classifier. In the preprocessing step, we optimize the dimension of the dataset by the proposed SSO-RF approach and finds an optimal set of features. SSO is an optimization method that has a strong global search capability and is used here for dimension optimization. The experimental results shows that the proposed approach performs better than the other approaches for the detection of all kinds of attacks present in the dataset.