diff --git a/x-pack/legacy/plugins/uptime/public/state/api/ml_anomaly.ts b/x-pack/legacy/plugins/uptime/public/state/api/ml_anomaly.ts index 57792d96b28e57..3022c45d8dd917 100644 --- a/x-pack/legacy/plugins/uptime/public/state/api/ml_anomaly.ts +++ b/x-pack/legacy/plugins/uptime/public/state/api/ml_anomaly.ts @@ -30,8 +30,8 @@ const getJobPrefix = (monitorId: string) => { // Subtracting ML_JOB_ID constant as well const postfix = '_' + ML_JOB_ID; - if ((prefix + postfix).length >= 64) { - return prefix.substring(0, 64 - postfix.length - 1) + '_'; + if ((prefix + postfix).length > 64) { + return prefix.substring(0, 64 - postfix.length) + '_'; } return prefix + '_'; };