欢迎光临
我们一直在努力

sed小知识

[dd logs]$ tail -f catalina.out
[DEBUG] [New I/O client worker #1-2] 2017-07-04T15:00:33.461+0800 com.alibaba.dubbo.remoting.exchange.support.header.HeartbeatHandler:received:82>  [DUBBO] Receive heartbeat response in thread New I/O client worker #1-2, dubbo version: 2.5.3, current host: 172.16.8.3
[DEBUG] [localhost-startStop-1-SendThread(vt28:2183)] 2017-07-04T15:00:34.790+0800 org.apache.zookeeper.ClientCnxn:readResponse:742> Got ping response for sessionid: 0x65cee405c9e004d after 0ms
[DEBUG] [New I/O client worker #1-3] 2017-07-04T15:00:35.329+0800
com.alibaba.dubbo.remoting.exchange.support.header.HeartbeatHandler:received:72>  [DUBBO] Received heartbeat from remote channel /172.16.8.22:18099, cause: The channel has no data-transmission exceeds a heartbeat period: 60000ms, dubbo version: 2.5.3, current host: 172.16.8.3
[DEBUG] [New I/O client worker #1-3] 2017-07-04T15:00:35.330+0800 com.alibaba.dubbo.remoting.exchange.support.header.HeartbeatHandler:received:72>  [DUBBO] Received heartbeat from remote channel /172.16.8.22:18099, cause: The channel has no data-transmission exceeds a heartbeat period: 60000ms, dubbo version: 2.5.3, current host: 172.16.8.3
[DEBUG] [localhost-startStop-1-SendThread(vt27:2183)] 2017-07-04T15:00:43.100+0800 org.apache.zookeeper.ClientCnxn:readResponse:742> Got ping response for sessionid: 0x55cee4043800064 after 0ms
[DEBUG] [localhost-startStop-1-SendThread(vt28:2183)] 2017-07-04T15:00:44.800+0800 org.apache.zookeeper.ClientCnxn:readResponse:742> Got ping response for sessionid: 0x65cee405c9e004d after 0ms
[DEBUG] [localhost-startStop-1-SendThread(vt27:2183)] 2017-07-04T15:00:53.109+0800 org.apache.zookeeper.ClientCnxn:readResponse:742> Got ping response for sessionid: 0x55cee4043800064 after 0ms
[DEBUG] [localhost-startStop-1-SendThread(vt28:2183)] 2017-07-04T15:00:54.807+0800 org.apache.zookeeper.ClientCnxn:readResponse:742> Got ping response for sessionid: 0x65cee405c9e004d after 0ms
[DEBUG] [localhost-startStop-1-SendThread(vt27:2183)] 2017-07-04T15:01:03.116+0800 org.apache.zookeeper.ClientCnxn:readResponse:742> Got ping response for sessionid: 0x55cee4043800064 after 0ms
[DEBUG] [localhost-startStop-1-SendThread(vt28:2183)] 2017-07-04T15:01:04.816+0800 org.apache.zookeeper.ClientCnxn:readResponse:742> Got ping response for sessionid: 0x65cee405c9e004d after 0ms
^C

[dd logs]$ sed -n '/2017-07-04T15:00:43.100+0800/,/2017-07-04T15:01:04.816+0800/p' catalina.out>/tmp/log.txt

[dd logs]$ cat /tmp/log.txt
[DEBUG] [localhost-startStop-1-SendThread(vt27:2183)] 2017-07-04T15:00:43.100+0800 org.apache.zookeeper.ClientCnxn:readResponse:742> Got ping response for sessionid: 0x55cee4043800064 after 0ms
[DEBUG] [localhost-startStop-1-SendThread(vt28:2183)] 2017-07-04T15:00:44.800+0800 org.apache.zookeeper.ClientCnxn:readResponse:742> Got ping response for sessionid: 0x65cee405c9e004d after 0ms
[DEBUG] [localhost-startStop-1-SendThread(vt27:2183)] 2017-07-04T15:00:53.109+0800 org.apache.zookeeper.ClientCnxn:readResponse:742> Got ping response for sessionid: 0x55cee4043800064 after 0ms
[DEBUG] [localhost-startStop-1-SendThread(vt28:2183)] 2017-07-04T15:00:54.807+0800 org.apache.zookeeper.ClientCnxn:readResponse:742> Got ping response for sessionid: 0x65cee405c9e004d after 0ms
[DEBUG] [localhost-startStop-1-SendThread(vt27:2183)] 2017-07-04T15:01:03.116+0800 org.apache.zookeeper.ClientCnxn:readResponse:742> Got ping response for sessionid: 0x55cee4043800064 after 0ms
[DEBUG] [localhost-startStop-1-SendThread(vt28:2183)] 2017-07-04T15:01:04.816+0800 org.apache.zookeeper.ClientCnxn:readResponse:742> Got ping response for sessionid: 0x65cee405c9e004d after 0ms
[cloud@vt3 logs]$

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。