Skip to content

Commit 589fc9d

Browse files
committed
Update usage queries to reference auditlog.UserAuditEvent
1 parent 2903c9e commit 589fc9d

File tree

6 files changed

+11
-13
lines changed

6 files changed

+11
-13
lines changed

LDK/resources/queries/core/DistinctUsersByMonth.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ year(a.date) as year,
2828
month(a.date) as month,
2929
a.CreatedBy.DisplayName as user
3030

31-
FROM "/".auditlog.audit a
31+
FROM "/".auditlog.UserAuditEvent a
3232

33-
WHERE a.EventType = 'UserAuditEvent' AND a.Comment LIKE '%logged in%'
33+
WHERE a.Comment LIKE '%logged in%'
3434

3535
GROUP BY year(a.date), month(a.date), a.CreatedBy.DisplayName
3636

LDK/resources/queries/core/SiteUsageByDay.sql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ CASE
2727
END as dayOfWeek,
2828
count(*) AS Logins
2929

30-
FROM "/".auditlog.audit a
30+
FROM "/".auditlog.UserAuditEvent a
3131

32-
WHERE a.EventType = 'UserAuditEvent'
33-
AND a.Comment LIKE '%logged in%'
32+
WHERE a.Comment LIKE '%logged in%'
3433
GROUP BY cast(a.date as date)

LDK/resources/queries/core/SiteUsageByHour.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ SELECT
1919
hour(a.date) as Hour,
2020
count(*) AS Visits
2121

22-
FROM "/".auditlog.audit a
22+
FROM "/".auditlog.UserAuditEvent a
2323

24-
WHERE a.EventType = 'UserAuditEvent' AND a.Comment LIKE '%logged in%'
24+
WHERE a.Comment LIKE '%logged in%'
2525

2626
GROUP BY hour(a.date)

LDK/resources/queries/core/SiteUsageByMonth.sql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ month(a.date) as month,
2020
cast(cast(year(a.date) as varchar) || '-' || cast(month(a.date) as varchar) || '-01' as DATE) as date,
2121
count(*) AS Logins
2222

23-
FROM "/".auditlog.audit a
23+
FROM "/".auditlog.UserAuditEvent a
2424
--FROM audit_pg.auditLog a
2525

26-
WHERE a.EventType = 'UserAuditEvent'
27-
AND a.Comment LIKE '%logged in%'
26+
WHERE a.Comment LIKE '%logged in%'
2827

2928
GROUP BY year(a.date), month(a.date)

LDK/resources/queries/core/SiteUsageByUser.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ PARAMETERS(MinDate TIMESTAMP)
1818
SELECT
1919
a.CreatedBy,
2020
COUNT(a.Date) AS LogInCount
21-
FROM "/".auditlog.audit a
21+
FROM "/".auditlog.UserAuditEvent a
2222
WHERE a.Comment LIKE '%logged in%' AND cast(a.date as date) >= cast(MinDate as date)
2323
GROUP BY a.CreatedBy

LDK/resources/queries/core/SiteUsagePerGroup.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ a.EventType
2323
FROM core.groups g
2424

2525
LEFT JOIN core.Members m ON (g.UserId = m.GroupId.UserId)
26-
LEFT JOIN "/".auditlog.audit a
27-
ON (a.CreatedBy.UserId = m.UserId.UserId AND a.EventType = 'UserAuditEvent' AND a.Comment LIKE '%logged in%')
26+
LEFT JOIN "/".auditlog.UserAuditEvent a
27+
ON (a.CreatedBy.UserId = m.UserId.UserId AND a.Comment LIKE '%logged in%')
2828

2929
WHERE g.Name IS NOT NULL
3030
AND g.Name != ''

0 commit comments

Comments
 (0)