This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

SQL Script - Audit events

--below script will give result set of audit events

SELECT DISTINCT

   DATEADD(hh, -7, ae.[TimeLoggedUtc]) TimeLogged

   ,ae.[AccountID]

   ,ae.[AuditEventMessage] [Audit Event]

FROM [SolarWindsOrion].[dbo].[AuditingEvents] ae WITH (NOLOCK)

INNER JOIN [SolarWindsOrion].[dbo].[Events] e WITH (NOLOCK) ON e.NetObjectID = ae.NetObjectID

WHERE ae.[TimeLoggedUtc] > DATEADD (DAY, -1, GETDATE())

GROUP BY ae.[TimeLoggedUtc], ae.[AccountID], ae.[AuditEventMessage], e.Message

ORDER BY DATEADD(hh, -7, ae.[TimeLoggedUtc]) DESC

Thanks.

Mahidhar Vattem