如何获取我们有错误的服务器的计数等于是?

时间:2017-02-23 20:22:14

标签: awk

cat file.txt
[ERROR]   : yes
[Server]  : abc
[Status]  : completed;
[ERROR]   : yes
[Server]  : abc
[Status]  : completed;
[ERROR]   : yes
[Server]  : abc
[Status]  : completed;
[ERROR]   : no
[Server]  : fgh
[Status]  : completed;
[ERROR]   : yes
[Server]  : def
[Status]  : completed;
[ERROR]   : yes
[Server]  : abc
[Status]  : completed;
  

预期输出:Wherver我们在错误行中有,我们必须添加   从第二行开始的那个服务器的值,然后计算那些值   错误行包含yes。

abc 4
def 1

0 个答案:

没有答案