Skip to content

Commit

Permalink
fix Pega0075 alert report parsing error
Browse files Browse the repository at this point in the history
  • Loading branch information
vargm committed Jan 19, 2022
1 parent 0ad4924 commit 877c205
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit 877c205

Please sign in to comment.