Last active
September 14, 2015 22:11
-
-
Save ericzumba/0a2a1ee5532f7fc51049 to your computer and use it in GitHub Desktop.
count log lines per second
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat log/chupacabra.log | grep -o -E "[0-9]{2}:[0-9]{2}:[0-9]{2}" | uniq -c | |
# matches the whole date at the begining of the line | |
tail -n 100 log/chupacabra.log | grep -o -E "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}" | uniq -c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To grab only the counts
cat counts_and_times_file | grep -o -E "^\s*(\d*)\s{1}"