打印在开始时间和结束时间之间匹配特定图案的线条的工作。在
日志行示例:
Fri Mar 01 HH:MM:SS YYYY:thresholdcrossed
我正在寻找一个等效的如下:
cat /path/file.log | egrep -v "exec|param" | grep thresholdcrossed | sed -n /$start/,/$stop/ >output.file
start和stop将是用户根据搜索的开始和停止时间生成的变量。在
这将给我一个使用正则表达式的行的匹配,但我无法得到所有两个时间戳之间匹配的行。在
^{pr2}$
您可以通过执行二进制搜索来优化这一点,以便在开始时间之后找到第一行。在
相关问题 更多 >
编程相关推荐