I want to get the \"GET\" queries from my server logs.
For example, this is the server log
1.0.0.127.in-addr.arpa - - [10/Jun/2012
I was trying to do this and came across this link: https://www.unix.com/shell-programming-and-scripting/153101-print-next-word-after-found-pattern.html
Summary: use grep to find matching lines, then use awk to find the pattern and print the next field:
grep pattern logfile | \
awk '{for(i=1; i<=NF; i++) if($i~/pattern/) print $(i+1)}'
If you want to know the unique occurrences:
grep pattern logfile | \
awk '{for(i=1; i<=NF; i++) if($i~/pattern/) print $(i+1)}' | \
sort | \
uniq -c