Near Linear Time Detection of Distance-Based Outliers and Applications to Security