tomcat access log get all request urls

#! /bin/bash
#Scp all server tomcat access logs to /opt/shencl/logs/ on the same machine, execute this script, you can get all urls

DIR_NAME="/opt/shencl/logs/"
REPORT_FILENAME="/opt/shencl/url.txt"

for line in `dir $DIR_NAME`
do
  line=${DIR_NAME}${line}
  echo current file is $line
  cat $line | awk {'print "http://"substr($6,0,length($6)-1)'} >> $REPORT_FILENAME
done

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327032287&siteId=291194637