diff --git a/libs/dao/src/main/java/com/akto/dao/audit_logs/ApiAuditLogsDao.java b/libs/dao/src/main/java/com/akto/dao/audit_logs/ApiAuditLogsDao.java index 3fa068a57a..85e3917c38 100644 --- a/libs/dao/src/main/java/com/akto/dao/audit_logs/ApiAuditLogsDao.java +++ b/libs/dao/src/main/java/com/akto/dao/audit_logs/ApiAuditLogsDao.java @@ -28,7 +28,8 @@ public void createIndicesIfAbsent() { String[] fieldNames = { ApiAuditLogs.TIMESTAMP }; MCollection.createIndexIfAbsent(getDBName(), getCollName(), fieldNames, true); - fieldNames = new String[]{ApiAuditLogs.USER_EMAIL, ApiAuditLogs.USER_IP_ADDRESS}; + fieldNames = new String[]{ApiAuditLogs.USER_EMAIL, ApiAuditLogs.USER_IP_ADDRESS, ApiAuditLogs.TIMESTAMP}; + MCollection.createIndexIfAbsent(getDBName(), getCollName(), fieldNames, true); } @Override