‎01-03-2017 11:27 PM
Solved! Go to Solution.
‎01-04-2017 05:51 AM
Select Top 1000000 tblNtlog.TimeGenerated,
tblAssets.AssetID,
Case tblNtlog.LogfileID When 1 Then 'Application' When 2 Then 'Log'
When 3 Then 'System' End As Log,
tblNtlog.Eventcode,
tblAssets.AssetName,
Case tblNtlog.Eventtype When 1 Then 'everrorsm.png'
When 2 Then 'evwarningsm.png' When 3 Then 'evinformationsm.png' End As icon,
Case tblNtlog.Eventtype When 1 Then 'Error' When 2 Then 'Warning'
When 3 Then 'Information' End As Type,
tblNtlogMessage.Message
From tblAssets
Inner Join tblAssetGroupLink On tblAssets.AssetID = tblAssetGroupLink.AssetID
Inner Join tblAssetGroups On tblAssetGroups.AssetGroupID =
tblAssetGroupLink.AssetGroupID
Inner Join tblNtlog On tblAssets.AssetID = tblNtlog.AssetID
Inner Join tblNtlogMessage On tblNtlogMessage.MessageID = tblNtlog.MessageID
Inner Join tblNtlogSource On tblNtlogSource.SourcenameID =
tblNtlog.SourcenameID
Inner Join tblNtlogUser On tblNtlogUser.LoguserID = tblNtlog.LoguserID
Where tblNtlog.TimeGenerated > GetDate() - 7 And tblNtlog.Eventcode Not Like
'1111' And tblNtlog.Eventcode Not Like '1112' And tblAssetGroups.AssetGroup =
'Production'
Order By tblNtlog.TimeGenerated Desc
‎01-04-2017 05:51 AM
Select Top 1000000 tblNtlog.TimeGenerated,
tblAssets.AssetID,
Case tblNtlog.LogfileID When 1 Then 'Application' When 2 Then 'Log'
When 3 Then 'System' End As Log,
tblNtlog.Eventcode,
tblAssets.AssetName,
Case tblNtlog.Eventtype When 1 Then 'everrorsm.png'
When 2 Then 'evwarningsm.png' When 3 Then 'evinformationsm.png' End As icon,
Case tblNtlog.Eventtype When 1 Then 'Error' When 2 Then 'Warning'
When 3 Then 'Information' End As Type,
tblNtlogMessage.Message
From tblAssets
Inner Join tblAssetGroupLink On tblAssets.AssetID = tblAssetGroupLink.AssetID
Inner Join tblAssetGroups On tblAssetGroups.AssetGroupID =
tblAssetGroupLink.AssetGroupID
Inner Join tblNtlog On tblAssets.AssetID = tblNtlog.AssetID
Inner Join tblNtlogMessage On tblNtlogMessage.MessageID = tblNtlog.MessageID
Inner Join tblNtlogSource On tblNtlogSource.SourcenameID =
tblNtlog.SourcenameID
Inner Join tblNtlogUser On tblNtlogUser.LoguserID = tblNtlog.LoguserID
Where tblNtlog.TimeGenerated > GetDate() - 7 And tblNtlog.Eventcode Not Like
'1111' And tblNtlog.Eventcode Not Like '1112' And tblAssetGroups.AssetGroup =
'Production'
Order By tblNtlog.TimeGenerated Desc
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now