cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
HamidReza
Engaged Sweeper
For Example server XXXXX01 Total Application hang Number= 4

Select Top 1000000 tblAssets.AssetName As AssetName1,
tblAssets.Domain,
tblAssets.AssetID,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblNtlog.Eventcode,
Case tblNtlog.Eventtype
When 1 Then 'Error'
When 2 Then 'Warning'
When 3 Then 'Information'
When 4 Then 'Security Audit Success'
When 5 Then 'Security Audit Failure'
End As EventType,
tblNtlog.TimeGenerated,
tblNtlogFile.Logfile
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblNtlog On tblNtlog.AssetID = tblAssets.AssetID
Inner Join tblNtlogFile On tblNtlogFile.LogfileID = tblNtlog.LogfileID
Where (tblAssets.AssetName = 'XXXXX01' Or tblAssets.AssetName =
'XXXXX02' Or tblAssets.AssetName = 'XXXXX03' Or
tblAssets.AssetName = 'XXXXX04') And tblNtlog.Eventcode = '1002' And
Case tblNtlog.Eventtype
When 1 Then 'Error'
When 2 Then 'Warning'
When 3 Then 'Information'
When 4 Then 'Security Audit Success'
When 5 Then 'Security Audit Failure'
End = 'Error' And tblNtlog.TimeGenerated > GetDate() - 7
Order By AssetName1,
tblAssets.Domain,
tblNtlog.TimeGenerated Desc
1 REPLY 1
HamidReza
Engaged Sweeper
Select Top 1000000 tblAssets.AssetName,
tblAssets.Domain,
tblAssets.AssetID,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.Lastseen,
tblAssets.Lasttried,
case when count.count is null
then 0
else count.count end as [Number of 10016]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
left Join (select Eventcode, assetid, count(assetid) as Count from tblntlog where TimeGenerated > GetDate() - 7 and Eventcode = 10016 group by assetid,eventcode) Count on Count.assetid = tblassets.assetid
Where (tblAssets.AssetName in ('XXXXX01','XXXXX02','XXXXX03','XXXXX04'))
Order By AssetName,
tblAssets.Domain