小编aLe*_*LeX的帖子

如何过滤某个时间范围内的日志

这是我的日志格式(为了演示而简化)

2018-04-12 14:43:00.000 ERROR hello
2018-04-12 14:44:01.000 ERROR world
2018-04-12 14:44:03.000 INFO this is a multi-line log
NOTICE THIS LINE, this line is also part of the log
2018-04-12 14:46:00.000 INFO foo
Run Code Online (Sandbox Code Playgroud)

那么如何过滤日志[2018-04-12 14:44:00.000, 2018-04-12 14:45:00.000)以产生以下输出呢?

2018-04-12 14:44:01.000 ERROR world
2018-04-12 14:44:03.000 INFO this is a multi-line log
NOTICE THIS LINE, this line is also part of the log
Run Code Online (Sandbox Code Playgroud)

grep sed awk text-processing

6
推荐指数
1
解决办法
5万
查看次数

标签 统计

awk ×1

grep ×1

sed ×1

text-processing ×1