====== Logfile Analyse Apache ======
===== Welche IP hat wieviele Requests =====
cat | awk '{print $1}' | sort | uniq -c | sort -n
\\
===== Wieviele Requests in welcher Stunde =====
cat | awk -F ":" '{ print $2 }' | sort -n | uniq -c
\\
===== Wieviele Requests in welcher Minute =====
cat | awk -F ":" '{ print $2 ":" $3 }' | sort -n | uniq -c | sort -n
\\
===== Wieviele Requests pro Sekunde =====
cat | 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 | grep "HTTP" | awk '{ print $9 }' | sort -n | uniq -c | sort -n
\\
===== Bandbreite aller Zugriffe in Megabyte =====
echo `cat | grep "HTTP" | awk '{ print $10 '} | awk '{ sum+=$1} END {print sum}'`/1024/1024 | bc
\\
===== Was macht mein Apache Prozess =====
lsof -p