Filter content in ERRORLOG log file過濾log檔案的內容


Filter content in ERRORLOG log file

過濾log檔案的內容


1.Create a exclude text file(E:\Temp\Log\exclude.txt) with the contain below.

建立一個文字檔,填入要過濾的關鍵字,例如以下文字(每一行為一組關鍵字)

Error: 18456
Login failed for user

2.Start a Command Prompt as an Administrator and run the command below.

執行以下命令產生過濾後的ERRORLOG檔

type E:\Temp\Log\ERRORLOG | findstr /i /v /g:E:\Temp\Log\exclude.txt > E:\Temp\Log\ERRORLOG_Filtered.log

Reference:

Findstr
https://technet.microsoft.com/en-us/library/bb490907.aspx

 

Comments (0)

Skip to main content