我有一个日志,其中包含我不需要的数据,我想跟踪它并删除数据,以便:
[Tue Nov 07 2017 14:44:51 GMT+0100 (CET)] INFO :CREATE
[Tue Nov 07 2017 14:44:51 GMT+0100 (CET)] INFO {:name=>"Michal's new org", :time_zone=>"UTC"}
[Tue Nov 07 2017 14:44:51 GMT+0100 (CET)] INFO :FINAL_ATTRIBUTES
[Tue Nov 07 2017 14:44:51 GMT+0100 (CET)] INFO {:name=>"Michal's new org", :time_zone=>"UTC", :sync_version=>1}
[Tue Nov 07 2017 14:44:51 GMT+0100 (CET)] INFO :CREATE
[Tue Nov 07 2017 14:44:51 GMT+0100 (CET)] INFO {:action=>"create", :id=>7, :sync_version=>0, :type=>"user_organization", :details=>{}, :user_id=>28,
变成这样:
INFO :CREATE
INFO {:name=>"Michal's new org", :time_zone=>"UTC"}
INFO :FINAL_ATTRIBUTES
INFO {:name=>"Michal's new org", :time_zone=>"UTC", :sync_version=>1}
INFO :CREATE
INFO {:action=>"create", :id=>7, :sync_version=>0, :type=>"user_organization", :details=>{}, :user_id=>28,
我听说过multitail
但是文档没有帮助。
答案1
使用sed:
$ tail file.log | sed -e 's/^.*)]//'