Buffer records in GNU awk

后端 未结 2 683
囚心锁ツ
囚心锁ツ 2021-01-26 08:09

I\'m trying to make a script that will live watch some logs. I have a log of requests with each request formatted something like this,

---
id=273482
Result=Error         


        
2条回答
  •  孤街浪徒
    2021-01-26 08:26

    Here is the fix

    tail -f requestLog|awk 'BEGIN{RS="--*"}/Error/{split($1,a,"=");print a[2]}'
    

提交回复
热议问题