Commit e6ef2474 authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit new azbyka_stat files

parent ee7c85ac
#!/bin/sh
NS=/var/local/nginx-stat/fail2ban_stat.txt
echo "Fail2ban logs " > $NS
date >>$NS
TODAY=$(date "+%Y-%m-%d")
filter_today()
{
grep "^$TODAY"
}
cat /var/log/fail2ban.log | filter_today | grep -E "(Ban|Unban)" >>$NS
#!/bin/sh
IN="/var/log/nginx/azbyka_audio-access-redir*.log"
NS=/var/local/nginx-stat/nginx-azbyka-audio.txt
echo "Stat for audio azbyka requests, generated by $0 " > $NS
date >>$NS
format()
{
xargs printf "%5d %-100s %s\n"
}
for i in $IN ; do
echo >>$NS
echo >>$NS
case $(basename $i) in
azbyka_audio-access-redir1.log)
N=A01 ;;
azbyka_audio-access-redir2.log)
N=Telros ;;
azbyka_audio-access-redir3.log)
N="A03 (znakomstva)" ;;
azbyka_audio-access-redir4.log)
N="A04 (audio)" ;;
azbyka_audio-access-redir5.log)
N="DE01 (etersoft)" ;;
*)
N=Unknown
;;
esac
echo "-- $N $(basename $i) ------------------------------------------------------" >> $NS
#cat $i |
tail $i -n3000 | perl -p -e 's|.*"GET (.*) HTTP.*|\1|g' | sort | uniq -c | sort -n -r | head -n 15 | sed -e "s|/audio/audio1||g" >>$NS
echo >>$NS
tail $i -n3000 | perl -p -e 's|.*"GET (.*) HTTP.*|\1|g' | xargs -r dirname | sort | uniq -c | sort -n -r | head -n 15 | sed -e "s|/audio/audio1||g" >>$NS
echo >>$NS
tail $i -n3000 | perl -p -e 's|.*"GET (.*) HTTP.*|\1|g' | xargs -r dirname | xargs -r dirname | sort | uniq -c | sort -n -r | head -n 15 | sed -e "s|/audio/audio1||g" >>$NS
done
#!/bin/sh
NS=/var/local/nginx-stat/nginx-azbyka-http.txt
echo "Stat for azbyka http requests, generated by $0 " > $NS
date >>$NS
format()
{
xargs printf "%5d %-100s %s\n"
}
echo >>$NS
echo '--------------------------------------------------------' >> $NS
HA=/var/log/nginx/azbyka.ru-http-access.log
echo "requests from azbyka.ru pages" >>$NS
echo "(stats by last 3000 lines)" >>$NS
echo "0 from to" | format >> $NS
tail $HA -n3000 | grep -E 'from "https?://azbyka.ru' | perl -p -e 's|.*"GET (.*) HTTP.* from "(http.*?)".*|\2 http://azbyka.ru\1|g' | sort | uniq -c | sort -n -r | format >>$NS
echo >>$NS
echo '--------------------------------------------------------' >> $NS
echo "requests from other pages" >>$NS
echo "(stats by last 3000 lines)" >>$NS
echo "0 from to" | format >> $NS
tail $HA -n3000 | grep -v 'from "-"' | grep -E -v 'from "https?://azbyka.ru' | perl -p -e 's|.*"GET (.*) HTTP.* from "(http.*?)".*|\2 http://azbyka.ru\1|g' | sort | uniq -c | sort -n -r | format >>$NS
echo >>$NS
echo '--------------------------------------------------------' >> $NS
for i in /var/log/nginx/azbyka.ru-http-access.log ; do
[ -s "$i" ] || continue
echo
echo "$i (last 1000 lines)"
tail "$i" -n1000
done >>$NS
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment