我有一个脚本,通过HTTP访问日志推移,过滤出基于正则表达式百通,并把它们拷贝到另一个文件中的一些行:提高性能
param($workingdate=(get-date).ToString("yyMMdd"))
Get-Content "access-$workingdate.log" |
Select-string -pattern $pattern |
Add-Content "D:\webStatistics\log\filtered-$workingdate.log"
我的日志可能非常大(高达2GB),最多需要15分钟才能运行。我有什么可以改善上述表现的表现吗?
谢谢你的想法!
相关和有用:http://stackoverflow.com/questions/31674667/is-there-a-way-to-optimise-my-powershell-function-for-removing-pattern-matches-f –