summaryrefslogtreecommitdiffstats
path: root/weblog-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'weblog-model.lua')
-rw-r--r--weblog-model.lua20
1 files changed, 11 insertions, 9 deletions
diff --git a/weblog-model.lua b/weblog-model.lua
index d5fa4da..cbf200a 100644
--- a/weblog-model.lua
+++ b/weblog-model.lua
@@ -522,6 +522,7 @@ local function checkwords(logentry)
_,instcnt = string.lower(logentry.URL):gsub(thisline, " ")
if instcnt ~= 0 then
logentry.ignoreme = true
+ --logme("ignoring...")
break
end
end
@@ -532,7 +533,7 @@ local function checkwords(logentry)
if not thisline then
break
end
-
+
_,instcnt = string.lower(logentry.URL):gsub(thisline, " ")
if instcnt ~= 0 then
-- logme("instcnt = "..instcnt)
@@ -543,20 +544,22 @@ local function checkwords(logentry)
end
--check for DansGuardian actions
- if string.find(logentry.URL,"*DENIED*") then
+ if (logentry.reason and logentry.reason ~= "") then
+ if string.find(logentry.reason,"DENIED") then
-- logme("*Denied*")
logentry.deniedyesno=1
- elseif string.find(logentry.URL,"GBYPASS") then
+ elseif string.find(logentry.URL,"GBYPASS") then
-- logme("GBYPASS")
logentry.bypassyesno=1
- elseif string.find(logentry.URL,"*OVERRIDE*") then
+ elseif string.find(logentry.reason,"OVERRIDE") then
-- logme("*OVERRIDE*")
logentry.bypassyesno=1
+ end
end
--check for Squark actions
if (logentry.squarkaction and logentry.squarkaction ~= "") then
- logme("squarkaction="..logentry.squarkcategory)
+ --logme("squarkaction="..logentry.squarkaction)
if string.find(logentry.squarkaction, "blocked") then
logentry.deniedyesno=1
elseif string.find(logentry.squarkaction,"overridden") then
@@ -608,13 +611,12 @@ local function parsesquidlog(line)
bytes=words[5],
method=words[6],
URL=words[7],
- clientuserid=words[8],
+ clientuserid=string.gsub(words[8],"%%(%x%x)",""),
peerstatus=string.match(words[9] or "", "^[^/]*"),
peerhost=string.match(words[9] or "", "[^/]*$"),
squarkcategory=string.match(words[11] or "", "^[^,]*"),
squarkaction=string.match(words[11] or "", "[^,]*$")}
-
-
+
checkwords(logentry)
-- Don't care about local requests (from DG) (this check also removes blank lines)
@@ -645,7 +647,7 @@ local function parsedglog(line)
if logentry.shortreason == "" then
logentry.shortreason = logentry.reason
end
- logentry.score = string.match(logentry.reason, "^.*: ([0-9]+) ")
+ --logentry.score = string.match(logentry.reason, "^.*: ([0-9]+) ")
logentry.logdatetime = string.gsub(logentry.logdatetime, "%.", "-")
return logentry
end