blob: 06b059ce2750a5d278778606f4d8f5229e8f6d28 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
@(include "txrban")
@(next @(open-tail "/var/log/apache2/www.kylheku.com.log" "r" nil))
@(repeat)
@ (all)
@ip - - [@(n day)/@(m month)/@(n year):@(n hour):@(n min):@(n sec) @nil] "@method @uri @proto/@ver" @err @bytes "@ref" "@agent"
@ (and)
@ (if (search-regex agent #/Googlebot|bingbot|baidu/))
@ (bind points nil)
@ (elif (search-regex (downcase-str agent)
#/ezoom|bot|spider|crawler|scan|yandex|coccoc|github|python/))
@ (bind points 9)
@ (elif (and (not (memqual err '("200" "206" "301" "302" "304")))
(not (or (mequal (short-suffix uri) "ico" "jpg" "png" "gif")))))
)))
@ (bind points 1)
@ (else)
@ (bind points 0)
@ (end)
@ (end)
@ (do
(let ((time (make-time year month day hour min sec :auto)))
(if (or points (contains "cgit" uri))
(report ip time (or points 0))
(do-expiry time))))
@(end)
|