Pattern Detection based Network Diagnostics