Recently, I was searching logs for a multiple string patterns. There are multiple ways to achieve that using "grep -E <string1> grep -E <string2>". However, the below seemed more efficient
$ grep "08/Aug.*<service name>" access_log | cut -d[ -f2 | cut -d] -f1 | awk -F: '{print $2":00"}' | sort
-n | uniq -c
$ grep "08/Aug.*<service name>" access_log | cut -d[ -f2 | cut -d] -f1 | awk -F: '{print $2":00"}' | sort
-n | uniq -c
No comments:
Post a Comment