Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fetch columnd from (log) file. This example was used for tomcat access log
FILE=''
FILTER_EXPR=''
DELIM=' '
# col num -- 3, change if need another
cat $FILE |grep $FILTER_EXPR|awk -F"$DELIM" '{print $3}'|sort|uniq -c> result.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment