diff --git a/src/main/java/com/pega/gcs/logviewer/report/alert/PEGA0075ReportModel.java b/src/main/java/com/pega/gcs/logviewer/report/alert/PEGA0075ReportModel.java index 413617a..9f45603 100644 --- a/src/main/java/com/pega/gcs/logviewer/report/alert/PEGA0075ReportModel.java +++ b/src/main/java/com/pega/gcs/logviewer/report/alert/PEGA0075ReportModel.java @@ -109,18 +109,20 @@ public String getAlertMessageReportEntryKey(String dataText) { if ((queryStr.startsWith("insert")) || (queryStr.startsWith("begin batch"))) { - int beginIndex = queryStr.indexOf("insert into ") + 12; + int beginIndex = queryStr.indexOf("insert into "); int endIndex = queryStr.indexOf("("); - colfamily = queryStr.substring(beginIndex, endIndex); - + if ((beginIndex != -1) && (endIndex != -1)) { + colfamily = queryStr.substring(beginIndex + 12, endIndex); + } } else if (queryStr.startsWith("select")) { - int beginIndex = queryStr.indexOf("from ") + 5; + int beginIndex = queryStr.indexOf("from "); int endIndex = queryStr.indexOf(" where"); - colfamily = queryStr.substring(beginIndex, endIndex); - + if ((beginIndex != -1) && (endIndex != -1)) { + colfamily = queryStr.substring(beginIndex + 5, endIndex); + } } }