You'll need a short pipeline at least.
sed -e 's/([0-9]+.[0-9]+.[0-9]+.[0-9]+).*$/1/' -e t -e d access.log | sort | uniq -c
Which will print each IP (will only work with ipv4 though), sorted prefixed with the count.
I tested it with apache2's access.log (it's configurable though, so you'll need to check), and it worked for me. It assumes the IP-address is the first thing on each line.
The sed collects the IP-addresses (actually it looks for 4 sets of digits, with periods in between), and replaces the entire line with it. -e t
continues to the next line if it managed to do a substitution, -e d
deletes the line (if there was no IP address on it). sort
sorts.. :) And uniq -c
counts instances of consecutive identical lines (which, since we've sorted them, corresponds to the total count).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…