I want to grep multiple patterns from file and then print them with count. My patterns are like
Error code [61440] Error Description
Error code [61000] Error Description
Error code [61040] Error Description
[] contains numbers with variable length and also contain null, i can get count with following command, but to get that i have to see file and check number between [].
cat mylog.log | grep "Error code" | grep 61040 | wc -l
My desired output is like following
Error code [61440] = 90
Error code [61000] = 230
Error code [61040] = 567
Error Descriptiona fixed string or can it vary?