User Tools

Site Tools


linux:webserver:apache:log_analyse

Logfile Analyse Apache

Welche IP hat wieviele Requests

cat <logfile> | awk '{print $1}' | sort | uniq -c | sort -n


Wieviele Requests in welcher Stunde

cat <logfile> | awk -F ":" '{ print $2 }' | sort -n | uniq -c


Wieviele Requests in welcher Minute

cat <logfile> | awk -F ":" '{ print $2 ":" $3 }' | sort -n | uniq -c | sort -n


Wieviele Requests pro Sekunde

cat <logfile> | awk -F ":" '{ print $1 ":" $2 ":" $3 }' | sort -n | uniq -c | sort -n

Beispiel etwas schöner. Das sed muss aber angepasst werden:
cat access_final_20170502.log | awk -F ":" '{ print $1 ":" $2 ":" $3 }' | sort -n | uniq -c | sort -n | sed -e "s/\[02\/May\///"


Wieviele Zugriffe per HTTP Status Code

cat <logfile> | grep "HTTP" | awk '{ print $9 }' | sort -n | uniq -c | sort -n


Bandbreite aller Zugriffe in Megabyte

echo `cat <logfile> | grep "HTTP" | awk '{ print $10 '} | awk '{ sum+=$1} END {print sum}'`/1024/1024 | bc


Was macht mein Apache Prozess

lsof -p <pid>
linux/webserver/apache/log_analyse.txt · Last modified: by stone