Skip to content

Instantly share code, notes, and snippets.

@coboshm
Created February 8, 2015 22:03
Show Gist options
  • Save coboshm/196ed76b65cad07d8d04 to your computer and use it in GitHub Desktop.
Save coboshm/196ed76b65cad07d8d04 to your computer and use it in GitHub Desktop.
Get number of each petition access.log
#!/bin/bash
# Author: Marc Cobos
FILE=test.access.log
types=(GET PUT DELETE HEAD POST TRACE OPTIONS CONNECT PATCH);
for i in ${!types[*]}
do
COUNT=`grep ${types[$i]} $FILE |wc -l`;
echo "$COUNT: ${types[$i]}";
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment