Analyzing multiple accesslog files

— generate beBigAndTradeDepositByTremList access history frequency for each access log per minute

for i in `ls -ltr | grep -i access| awk '{print $NF}'` 
do 
name=`ls -l | grep -w $i | awk '{print $6""$7}'|sed 's/://g'` 
grep beBigAndTradeDepositByTremList $i | awk '{print $3}' | awk -F: '{print $1":"$2}' | uniq -c | awk '{print $2,$1}' > "$name".txt 
done

— generate beBigAndTradeDepositByTremList access history IP for each access log per minute

for i in `ls -ltr | grep -i access| awk '{print $NF}'` 
do 
name=`ls -l | grep -w $i | awk '{print $6""$7}'|sed 's/://g'` 
grep beBigAndTradeDepositByTremList $i | awk '{print $NF}' | sort| uniq -c | awk '{print $2,$1}' | sort -k2n > /tmp/20160815/"$name".IP.txt 
done
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s