I have a .sh
file that takes a log file and extracts data and makes reports. I would like to calculate what percentage of the total lines does an error pop-up (top talkers).
So far I have this:
awk '// {print $4, substr($0, index($0,$9))}' | sort \
| uniq -cd | sort -nr | head -n20 > $filename-sr1.tmp
This outputs two columns, the count followed by the line.
How can I take just the count to make the calculations.
Eg. count / total_lines = 0.000000
...