Checking the size of the logs

List and order table starting from the highest count of log types.

Written by Ines

Last published at: November 18th, 2020

Query Description

List and order table starting from the highest count of log types.

Query Results

Query

SELECT 

'LogChildType'=CASE

WHEN LogChildType = 0 THEN 'DeviceInventory'

WHEN LogChildType = 1 THEN 'Connect'

WHEN LogChildType = 2 THEN 'Disconnect'

WHEN LogChildType = 3 THEN 'Lock'

WHEN LogChildType = 4 THEN 'Unlock'

WHEN LogChildType = 5 THEN 'UnlockAttemptFail'

WHEN LogChildType = 6 THEN 'GuiStart'

WHEN LogChildType = 7 THEN 'GuiEnd'

WHEN LogChildType = 8 THEN 'DeviceLogin'

WHEN LogChildType = 9 THEN 'DeviceLogoff'

WHEN LogChildType = 10 THEN 'ConnectorLogin'

WHEN LogChildType = 11 THEN 'ConnectorLogoff'

WHEN LogChildType = 12 THEN 'ConnectorResourceList'

WHEN LogChildType = 13 THEN 'ConnectorErrors'

WHEN LogChildType = 14 THEN 'ResourceLaunch'

WHEN LogChildType = 15 THEN 'ResourceEnd'

WHEN LogChildType = 16 THEN 'ResourceLaunchFail'

WHEN LogChildType = 17 THEN 'ActiveProfile'

WHEN LogChildType = 18 THEN 'BrowserLinkSelect'

WHEN LogChildType = 19 THEN 'LdapPasswordChange'

WHEN LogChildType = 20 THEN 'PowerAction'

WHEN LogChildType = 21 THEN 'SecurityCentreStatus'

WHEN LogChildType = 22 THEN 'WindowsUpdateStatus'

WHEN LogChildType = 23 THEN 'WindowsFirewallStatus'

WHEN LogChildType = 24 THEN 'WifiAdapterStatus'

WHEN LogChildType = 25 THEN 'VMDetectionStatus'

WHEN LogChildType = 26 THEN 'ProcessActionApply'

WHEN LogChildType = 27 THEN 'ProcessActionRelease'

WHEN LogChildType = 28 THEN 'LocalApplicationLaunch'

WHEN LogChildType = 29 THEN 'AEPAllow'

WHEN LogChildType = 30 THEN 'AEPDeny'

WHEN LogChildType = 31 THEN 'SessionActionApply'

WHEN LogChildType = 32 THEN 'SessionActionRelease'

WHEN LogChildType = 33 THEN 'SEPStop'

WHEN LogChildType = 34 THEN 'SEPNotify'

WHEN LogChildType = 35 THEN 'ValidationToolResult'

WHEN LogChildType = 36 THEN 'DeviceInventoryInstalledWindowsUpdate'

WHEN LogChildType = 37 THEN 'UrlBlocked'

WHEN LogChildType = 38 THEN 'UsbDeny'

END,COUNT(LogChildType) AS 'Count'

FROM Logs

GROUP BY LogChildType

ORDER BY 'Count' DESC