Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions updater/scripts/api-requests-by-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
echo -e "user\trequests"

zcat -f /var/log/github/unicorn.log.1* |
grep -F 'request_category=api' |
grep -F 'request_category="api"' |
grep -Fv 'remote_address=127.0.0.1' |
grep -oP 'current_user=\K\S+' |
grep -oP 'gh.actor.login=\K\S+' |
grep -Fvx 'nil' |
sort |
uniq -ic |
Expand Down
2 changes: 1 addition & 1 deletion updater/scripts/api-requests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
echo -e "resource\ttype\tsource IP\trequests"

zcat -f /var/log/haproxy.log.1* |
perl -ne 'print if s/.*haproxy\[\d+\]: ([^:]+).*\/api\/v3\/([^\/\? ]+)\/([^\/\? ]+?(\/[^\/\? ]+)).*/\1 \2 \3/' |
perl -ne 'print if s/.*haproxy-frontend\[\d+\]: ([^:]+).*\/api\/v3\/([^\/\? ]+)\/([^\/\? ]+?(\/[^\/\? ]+)).*/\1 \2 \3/' |
grep -v '^127.0.0.1' |
sort |
uniq -ic |
Expand Down
6 changes: 5 additions & 1 deletion updater/scripts/git-protocol.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#
echo -e "Git protocol\tconnections"

zcat -f /var/log/syslog.1* |
TMPDIR=`mktemp -d`
sudo cp -a /var/log/babeld/babeld.log.1.gz $TMPDIR
zcat -f $TMPDIR/babeld.log.1.gz |
# Remove the leading time stamp
cut --characters 17- |
# Remove the host name
Expand All @@ -15,3 +17,5 @@ zcat -f /var/log/syslog.1* |
sort |
uniq -c |
awk '{printf("%s\t%s\n",$2,$1)}'
sudo rm -f $TMPDIR/babeld.log.1.gz
rmdir $TMPDIR
6 changes: 5 additions & 1 deletion updater/scripts/git-requests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#
echo -e "repository\tsource IP\trequests"

zcat -f /var/log/syslog.1* |
TMPDIR=`mktemp -d`
sudo cp -a /var/log/babeld/babeld.log.1.gz $TMPDIR
zcat -f $TMPDIR/babeld.log.1.gz |
# Remove the leading time stamp
cut --characters 17- |
# Remove the host name
Expand All @@ -16,3 +18,5 @@ zcat -f /var/log/syslog.1* |
uniq -ic |
sort -rn |
awk '{printf("%s\t%s\t%s\n",$3,$2,$1)}'
sudo rm -f $TMPDIR/babeld.log.1.gz
rmdir $TMPDIR