I have a script that generates a backup error log for several accounts we have. . What I need is to group errors based on a few static pieces of information.. The file has about 8,000 lines.
What I want to do is take the lines that match based on certain fields I want to group them and show the first line and count how many show up (including the line being shown). I will attach the file.
Here is what I want that file to look like when it is done:
TS00600038 has the below errors:
Error: ECN5 Cat: 7 Code: Access is denied. (\\\\SERVER01\\D$\\Users\\
maryf\\My Documents\\) Found: 9 times
Error: ECN53 Cat: 7 Code: The network path was not found. (\\\\WSK02\\C$) Found:2 times
TS00600233 has the below errors:
Error: ECN-1073741763 Cat: 1 Failed to send buffer. (supdate.exe) ECN-1073741763 Found: 2 Times
Error: ECN-1073741801 Cat: 1 Lost connection to System. ECN-1073741801 Found: 2 times.
My thoughts were to use an awk string to do this but I don't know how hard it would be to that. Is this even possible?
Now the file I am giving here does not have tab separation but I can do that.
Start Free Trial