diff options
Diffstat (limited to 'weblog-model.lua')
-rw-r--r-- | weblog-model.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/weblog-model.lua b/weblog-model.lua index de837a5..dc9591b 100644 --- a/weblog-model.lua +++ b/weblog-model.lua @@ -571,9 +571,9 @@ local function parsesquidlog(line) peerstatus=string.match(words[9] or "", "^[^/]*"), peerhost=string.match(words[9] or "", "[^/]*$")} - logentry.logdatetime = os.date("%Y-%m-%d %H:%M:%S", logentry.logdatetime)..string.match(logentry.logdatetime, "%..*") - -- Don't care about local requests (from DG) - if logentry.clientip ~= "127.0.0.1" then + -- Don't care about local requests (from DG) (this check also removes blank lines) + if logentry.clientip and logentry.clientip ~= "127.0.0.1" then + logentry.logdatetime = os.date("%Y-%m-%d %H:%M:%S", logentry.logdatetime)..string.match(logentry.logdatetime, "%..*") return logentry end return nil @@ -584,7 +584,7 @@ local function parsedglog(line) local logentry = { logdatetime=words[1], clientuserid=words[2], clientip=words[3], URL=words[4], reason=words[5], method=words[6], bytes=words[7], shortreason=words[9]} - if logentry.reason ~= "" then + if logentry.reason and logentry.reason ~= "" then if logentry.shortreason == "" then logentry.shortreason = logentry.reason end |