summaryrefslogtreecommitdiffstats
path: root/apache.txr
blob: 81b78ecdae6e5c5f2ccd42b49fe0551d95329b8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
@(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 (not (memqual err '("200" "206" "301" "302" "304"))))
@      (bind points 1)
@    (else)
@      (bind points 0)
@    (end)
@  (end)
@  (do
     (let ((time (make-time year month day hour min sec :auto)))
       (if points
         (report ip time points)
         (do-expiry time))))
@(end)