Unsupervised machine learning is considered more challenging compared to supervised machine learning. This is due to dealing with uncategorized and unlabeled data. Many unsupervised algorithms are available, but the problem is in the sensitivity of the parameters of the algorithms. Moreover, unsupervised machine learning algorithms struggled with time constraints, especially with systems that need real-time processing such as anomaly detection systems. This article proposes a method for anomaly detection in real time. The proposed method used concepts inspired by the DBSCAN algorithm. Modifications were performed on the original version to improve the performance in terms of accuracy and time. The dataset used was MAWI, which is considered a standard in the network security area. The performance of the proposed algorithm was compared to other clustering algorithms such as KNN, K-Means, and PCA as well as the original version of the DBSCAN. The results showed promising aspects of the proposed algorithm because it provides efficient performance in terms of accuracy and time