mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-12-02 21:33:04 +01:00
fix(systemadmin): use the log file passed to the access log functions (#14320)
This commit is contained in:
1 parent
ff3767f564
commit
81a38b0075
1 file changed
+8
-8
@@ -153,34 +153,34 @@ function port_pro() {
|
||||
|
||||
# top10 of gain access to the ip address
|
||||
function accessip10() {
|
||||
awk '{counts[$(11)]+=1}; END {for(url in counts) print counts[url], url}' "$(retlog)"
|
||||
awk '{counts[$(11)]+=1}; END {for(url in counts) print counts[url], url}' "$(retlog "$1")"
|
||||
}
|
||||
|
||||
# top20 of Most Visited file or page
|
||||
function visitpage20() {
|
||||
awk '{print $11}' "$(retlog)" | sort | uniq -c | sort -nr | head -n 20
|
||||
awk '{print $11}' "$(retlog "$1")" | sort | uniq -c | sort -nr | head -n 20
|
||||
}
|
||||
|
||||
# top100 of Page lists the most time-consuming (more than 60 seconds) as well as the corresponding page number of occurrences
|
||||
function consume100() {
|
||||
awk '($NF > 60 && $7~/\.php/){print $7}' "$(retlog)" | sort -n | uniq -c | sort -nr | head -n 100
|
||||
awk '($NF > 60 && $7~/\.php/){print $7}' "$(retlog "$1")" | sort -n | uniq -c | sort -nr | head -n 100
|
||||
# if django website or other website make by no suffix language
|
||||
# awk '{print $7}' "$(retlog)" | sort -n | uniq -c | sort -nr | head -n 100
|
||||
# awk '{print $7}' "$(retlog "$1")" | sort -n | uniq -c | sort -nr | head -n 100
|
||||
}
|
||||
|
||||
# Website traffic statistics (G)
|
||||
function webtraffic() {
|
||||
awk '{sum+=$10} END {print sum/1024/1024/1024}' "$(retlog)"
|
||||
awk '{sum+=$10} END {print sum/1024/1024/1024}' "$(retlog "$1")"
|
||||
}
|
||||
|
||||
# Statistical connections 404
|
||||
function c404() {
|
||||
awk '($9 ~ /404/)' "$(retlog)" | awk '{print $9,$7}' | sort
|
||||
awk '($9 ~ /404/)' "$(retlog "$1")" | awk '{print $9,$7}' | sort
|
||||
}
|
||||
|
||||
# Statistical http status.
|
||||
function httpstatus() {
|
||||
awk '{counts[$(9)]+=1}; END {for(code in counts) print code, counts[code]}' "$(retlog)"
|
||||
awk '{counts[$(9)]+=1}; END {for(code in counts) print code, counts[code]}' "$(retlog "$1")"
|
||||
}
|
||||
|
||||
# Delete 0 byte file
|
||||
@@ -211,5 +211,5 @@ function getip() {
|
||||
|
||||
# Second concurrent
|
||||
function conssec() {
|
||||
awk '{if($9~/200|30|404/)COUNT[$4]++}END{for( a in COUNT) print a,COUNT[a]}' "$(retlog)" | sort -k 2 -nr | head -n10
|
||||
awk '{if($9~/200|30|404/)COUNT[$4]++}END{for( a in COUNT) print a,COUNT[a]}' "$(retlog "$1")" | sort -k 2 -nr | head -n10
|
||||
}
|
||||
Reference in new issue
Block a user