Sun Java System Web Server 6.1 SP9 Administrator's Guide

Running the Log Analyzer

The server-root/extras/log_anly directory contains the log analysis tool that runs through the Server Manager user interface. This log analyzer analyzes files in common log format only. The HTML document in the log_anly directory that explains the tool’s parameters. The server-root/extras/flex_anlg directory contains the command-line log analyzer for the flexible log file format. However, the Server Manager defaults to using the flexible log file reporting tool, regardless of whether you’ve selected common or flexible log file format.

Use the log analyzer to generate statistics about your default server, such as a summary of activity, most commonly accessed URLs and the server is accessed most frequently. You can run the log analyzer from the Sun Java System Web Server or the command line. The log analyzer cannot generate statistics for virtual servers other than the default server. However, statistics can be viewed for each virtual server as described in Viewing an Access Log File.

You must set the library path before attempting to run the flexanlg command line utility. The settings for various platforms are as follows:

Solaris and Linux:








Note –

Before running the log analyzer, you should archive the server logs. For more information about archiving server logs, see Archiving Log Files.

To run the log analyzer from the Server Manager, perform the follow these steps:

ProcedureTo run the log analyzer from the Server Manager

  1. From the Server Manager, click the Logs tab.

  2. Click Generate Report.

  3. Fill in the fields.

  4. Click OK.

    The report appears in a new window.

    For more information, see the Generate Report page in the online help.

    To analyze access log files from the command line, run the flexanlg tool, which is in the server-install/extras/flex_anlg directory.

    To run the flexanlg, type the following command at the command prompt:

    flexanlg [ -P ] [-n name] [-x] [-r] [-p order] [-i file]* [ -m 
    metafile ]* [ o file][ c opts] [-t opts] [-l opts]

    The following output describes the syntax.

    flexanlg -h.):
    -P: proxy log format                                  Default: no
    -n servername: The name of the server
    -x : Output in HTML                                   Default: no
    -r : Resolve IP addresses to hostnames                Default: no
    -p [c,t,l]: Output order (counts, time stats, lists)  Default: ctl
    -i filename: Input log file(s)                        Default: none
    -o filename: Output log file                          Default: stdout
    -m filename: Meta file(s)                             Default: none
    -c [h,n,r,f,e,u,o,k,c,z]: Count these item(s) -       Default: hnreuokc
        h: total hits
        n: 304 Not Modified status codes (Use Local Copy)
        r: 302 Found status codes (Redirects)
        f: 404 Not Found status codes (Document Not Found)
        e: 500 Server Error status codes (Misconfiguration)
        u: total unique URL’s
        o: total unique hosts
        k: total kilobytes transferred
        c: total kilobytes saved by caches
        z: Do not count any items.
    -t [sx,mx,hx, xx,z]: Find general stats - Default:s5m5h24x10
        s(number): Find top (number) seconds of log
        m(number): Find top (number) minutes of log
        h(number): Find top (number) hours of log
        u(number): Find top (number) users of log
        a(number): Find top (number) user agents of log
        r(number): Find top (number) referers of log
        x(number): Find top (number) for miscellaneous keywords
        z: Do not find any general stats.
    -l [cx,hx]: Make a list of - Default: c+3h5
        c(x,+x): Most commonly accessed URLs
                 (x: Only list x entries)
                 (+x: Only list if accessed more than x times)
        h(x,+x): Hosts (or IP addresses) most often accessing your server
                 (x: Only list x entries)
                 (+x: Only list if accessed more than x times)
        z: Do not make any lists