fork download
  1. #!/bin/bash
  2. log="2019/10/04 03:03:12.938 [error]: some exception happened
  3. 2019/10/04 03:03:12.938 [error]: some exception happened
  4. 2019/10/04 03:53:35.595 [info]: there is a benign error in the code"
  5.  
  6. grep '\[error]:' <<< "$log"
  7.  
  8. awk '$3 == "[error]:"' <<< "$log"
Success #stdin #stdout 0s 4188KB
stdin
Standard input is empty
stdout
2019/10/04 03:03:12.938 [error]: some exception happened
2019/10/04 03:03:12.938 [error]: some exception happened
2019/10/04 03:03:12.938 [error]: some exception happened
2019/10/04 03:03:12.938 [error]: some exception happened