Last active
August 29, 2015 14:04
-
-
Save asakasinsky/bcd9f0b429299d2b24e1 to your computer and use it in GitHub Desktop.
Gather Unique User-Agents from access_log
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
#!/bin/bash | |
# GUAFAL | |
# Gather User-Agents From Access Log | |
WORK_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
if [ "$1" == "" ]; then | |
echo "Sorry, i need an access_log path." | |
exit 1 | |
fi | |
FILE=$1 | |
if [ ! -f $FILE ]; | |
then | |
echo "access_log '$FILE' does not exist." | |
fi | |
awk -F'"' '/GET/ {print $6}' $FILE| sort -u >> $WORK_DIR/user-agents.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment