IntroInstallationSetupOptionsCustomizationInformationFAQ



Customization

Because I realize that a single program will not suit everyone's needs, I've built many options into this program. By using them, you can better control how it acts and expand it to fit your needs exactly. Below is a list of things you can do to customize MKStats.
$EXCLUDEFILE
When creating reports for your pages, there are many circumstances where you do not want certain directories or files to be counted. Using the $EXCLUDEFILE lets you be particular about which files you do not want counted. The format of the file is simple: An entry on each line of the file containing a full or partial URL to ignore. For example, your file may look like:
          /secret/file.html
          /private/
          /mystuff/me/goaway/
The URL's listed in the $EXCLUDEFILE are checked for at the beginning of each line being processed. That is, the /private/ entry about would cause the program to ignore any URL beginning with /private/, including all files and subdirectories. Putting a '/' as an entry in the $EXCLUDEFILE would cause the program to ignore all entries.

sub.process
You can make changes to the information being processed while the program is executing by defining a special subroutine. For example, if you have a script that is called to load a certain HTML page, you may want to count that as an access to the page itself, rather than tot he script. By writing a small routine to make this conversion, it can be done quite easily.

When MKStats runs, it will check for a file called sub.process in it's directory. If it is there, it will "require" it, which will load its contents into memory. Inside of this file, you must create a subroutine name "process" that will do your dirty work. By looking at the sub.readlog.clf file, you'll see where this fits in:

    unless
    (($site,$rfc931,$user,$when,$request,$status,$bytes)=
    /^(\S+) (\S+) (\S+) \[([^\]]+)] \"([^\"]+)" (\S+) (\S+)$/o)
      { $lineerrors++; next; }
    ($page) = ($request =~ m|[^\/]*(\S*)|);

    # If you've got other plans, let's do them!
    &process if (defined &process);
The variables available to you are in the second line, and should be self-explanatory. (If they aren't, you probably aren't ready to use this option :).

sub.index.*
The index pages for the reports are created from the sub.index.* routines. You can create your own style of index pages by writing a new sub.index file. For example, if you named your index file 'sub.index.mine' you would make $INDEXTYPE='mine'. It would then properly find the routine when running the program.

sub.readlog.*
Because there are a number of servers available, and not all follow the standard logging conventions, you can write your own version of the readlog routine to match your server. For example, if you modify the sub.readlog.clf file and name it 'sub.readlog.mine' you would set your $log_format variable to 'mine'.

Plug-in reports
Plug-in reports allow you to create your own custom reports and have them easily and instantly integrated with the rest of the reports. This way you can gather even more specific information that is of interest to you and make custom reports to view that data however you want. A separate document is dedicated to the Plugin Specification.

IntroInstallationSetupOptionsCustomizationInformationFAQ