Menu ▾ ▴

#3 StatViz bails out on "incorrect" log lines

open
nobody
None
5
2005-09-21
2005-09-21
No

StatViz bails out (exits) when encountering "incorrect"
log lines.

For instance, non-compliant(?) browsers that do not
specify "HTTP/1.x" at the end of the GET line causes
StatViz to exit. Also, a GET request for
"?variable=value" would cause StatViz to exit.

Proposed fixes:

Change the regexp in function processLogLine():

// SkipURLs
// --- snip ---
// CUSTOM: Changed regexp so that it can
handle requests not specifying protocol HTTP/1.x at the end
// if (preg_match("/^\w+ ([^?
]*).*HTTP\/1..$/", $logLine, $urlMatches) == 0)
$this->dieErr("couldn't figure out url from: " .
$line[$this->conf->LogURLColumn]);

if (preg_match('/^\w+ ([^? ]*)/', $logLine,
$urlMatches) == 0) $this->dieErr("couldn't figure out
url from: " . $line[$this->conf->LogURLColumn]);

Similarly, change the regexp in function analyze_line():

// normalize:: chop querystring
// CUSTOM: Changed regexp so that it can handle
requests not specifying protocol (HTTP/1.x) at the end
// if (preg_match("/^\w+ ([^? ]*).*HTTP\/1..$/",
$logLineURL, $urlMatches) == 0) $this->dieErr("couldn't
figure out url from: " . $logLineURL);
if (preg_match('/^\w+ ([^? ]*)/', $logLineURL,
$urlMatches) == 0) $this->dieErr("couldn't figure out
url from: " . $logLineURL);

Best regards,
Björn

Discussion

  • Björn Wiberg

    Björn Wiberg - 2005-12-12

    Logged In: YES
    user_id=971939

    Another suggestion related to this one -- please make it an
    option to ignore incorrect log lines, instead of the entire
    StatViz processing stopping because of such lines.

    Many thanks in advance!

    Best regards,
    Bjrn

     
  • Nobody/Anonymous

    Logged In: NO

    I forgot to say -- it would of course be great if StatViz
    could skip incorrect log lines with a warning instead of
    bailing out (maybe a configuration option).

    Best regards,
    Björn

     

Log in to post a comment.