开发者

Using Powershell to grep for the word pattern "Exception" in files

Background :

I have a log server with tons of gzip files containing text logs information.

Among these logs, there are "Exception" tags being written onto the text files and I would like to use powershell to find all the available "Exception" tags entries in the log text files.

I have been trying using the Powershell with the following cmdlets option b开发者_如何转开发ut I am stuck at the point to get the content inside the text files of the gzip files before I use Select-String to "Grep" out the word pattern "Exception" in the text files.

Get-ChildItem '##Location of my log files directory###' | 
    Sort-Object LastWriteTime -Descending |
    Select-Object -First 1 |
    Get-ChildItem | ###Lists of my gzip log files###

Question:

Could anyone advice me on how to enumerate through all the gzip log files in order to get the "Exception" tags entries written in all of the log files. Please do give examples in the form of Powershell Scripts or Powershell cmdlets.

Sincerely,

Derek

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜