Skip to content

Instantly share code, notes, and snippets.

@milovtim
Created November 10, 2017 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milovtim/4612772fe3cbfcb1485729ff3bbf9e9e to your computer and use it in GitHub Desktop.
Save milovtim/4612772fe3cbfcb1485729ff3bbf9e9e to your computer and use it in GitHub Desktop.
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