home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Spezial / SPEZIAL2_97.zip / SPEZIAL2_97.iso / ANWEND / ONLINE / SREFV12J / SREFLOGS.DOC < prev    next >
Text File  |  1997-06-04  |  17KB  |  407 lines

  1. 04 June 1997:  Configuring the SRE-Filter Common-Log Audit File
  2.  
  3. A) Introduction
  4.  
  5. In keeping with http server standards, SRE-Filter will maintain a
  6. common-log format audit file.
  7.  
  8. Besides offering a compact synopsis, a number of tools exist to help you
  9. analyze common-log files. Furthermore, as an adjunct to the common-log audit
  10. file, SRE-Filter can also record the browser used by each request (as
  11. well as the referer) in seperate log files.
  12.  
  13. This document discusses how to modify the SREFLOGS.INI file.  SREFLOGS.INI
  14. contains the configuration options for these three log files. These
  15. options include the host-specific (and port-specfic)  filenames for
  16. these log files, audit-suppression instructions, and a few display options.
  17.  
  18. At this moment, there is no SRE-Filter configurator for SREFLOGS.INI --
  19. you'll have to use your favorite text editor.  Also note that, as
  20. with most other SRE-Filter configuration files, you can change it
  21. on the fly (SRE-Filter checks SREFLOGS.INI about every 20 seconds).
  22.  
  23.  
  24. -------------------------------------------------
  25. B) Basic configuration
  26.  
  27. A few basic points:
  28.   i) If you want to record information to these audit files, you need to
  29.      enable the WRITE_LOGS parameter (you can use the configurator to do this).
  30.  
  31.  ii) If you are running a single-host server on port 80, and you
  32.      are happy to record all requests in a standard fashion, then you can
  33.      use the default version of SREFLOGS.INI.
  34.  
  35.      If you choose to do this, three files in the DATA\ directory
  36.      of the GoServe "working directory" (say, D:\GOSERVE\DATA)
  37.      will be created (and written to):
  38.         * COMMON.LOG -- the common-log audit file
  39.         * BROWSERS.LOG -- list of browsers
  40.         * REFERER.LOG -- list of referers
  41.         * COMBINED.LOG -- combination of common, referer, and browser logs.
  42.  
  43. iii) If post-filter processing has been suppressed (say, with the SEL-specific
  44.      NO_POSTFILTER permission), the request will not be recorded to these
  45.      audit files.
  46.  
  47.  iv) Advanced options: SRE-Filter will "lazy write" the audit files (about
  48.      once a minute).  SRE-Filter will also warn you (via the PMPRINTF
  49.      window) when a log file gets large (greater then 1M).  You can
  50.      change these limits by editing the POSTFCHK.RXX file.
  51.  
  52.   v) You can use the RENLOGS.CMD file as a sample of a "Scheduled Event" --
  53.      it will rename your common, browser, and referer logs on a
  54.      scheduled basis.
  55.  
  56. -------------------------------------------------
  57. C) Configuration options
  58.  
  59. Configuration is accomplished by setting variables in SREFLOGS.INI.
  60. The following lists the variables, with details below:
  61.  
  62. COMMONLOG           == Default common-log file
  63. COMMONLOG.nnn       == Common-log file for port nnn server.
  64. COMMONLOG.hostn     == Common-log file for the "hostn" host.
  65. COMMONLOG.hostn.nnn == Common-log file for the "hostn" host on port nnn.
  66.  
  67. BROWSERLOG           == Default browser log file
  68. BROWSERLOG.nnn       == Browser log file for port nnn server.
  69. BROWSERLOG.hostn     == Browser log file for the "hostn" host.
  70. BROWSERLOG.hostn.nnn == Browser log file for the "hostn" host on port nnn.
  71.  
  72. REFERERLOG           == Default referer log file
  73. REFERERLOG.nnn       == Referer log file for port nnn server.
  74. REFERERLOG.hostn     == Referer log file for the "hostn" host.
  75. REFERERLOG.hostn.nnn == Referer log file for the "hostn" host on port nnn.
  76.  
  77. COMBINEDLOG           == Default combined (common/referer/browser) log file
  78. COMBINEDLOG.nnn       == Cominbedlog file for port nnn server.
  79. COMBINEDLOG.hostn     == Combined log file for the "hostn" host.
  80. COMBINEDLOG.hostn.nnn == Combined log file for the "hostn" host on port nnn.
  81.  
  82.  
  83.  
  84. APACHE_MODE          == Select format for Browser and Referer logs 
  85.  
  86.  
  87. FORCE_REFERER        == Use a " - " when no referer request header is available
  88.  
  89. NOOPTIONS            == Do not record the portion of the request selector
  90.                         following the ?
  91.  
  92. NOHTTP               == Do not record the HTTP/1.0 portion of the request
  93.                         string
  94.  
  95. NOCODES              == List of "return codes" to not record.
  96.  
  97. NOUSER               == List of IP addresses, and SRE-Filter "usernames", to
  98.                         not record
  99.  
  100. NOREFERER           == List of IP addresses to not record in REFERER.LOG
  101.                        (COMMON, COMBINED and BROWSER logs do NOT pay attention to
  102.                         this parameter).
  103.  
  104.  
  105.  
  106. NOURL.1              == Stem variable of request selectors to not record
  107. NORUL.2
  108.  
  109. SCHED.1               == Scheduled programs to run
  110. SCHED.2
  111.  
  112.  
  113. ..
  114.  
  115. C.1) Configuration Details: COMMONGLOG, COMBINEDLOG, BROWSERLOG and REFERERLOG ----
  116.  
  117. The COMMONLOG, COMBINEDLOG, BROWSERLOG, and REFERERLOG "stem" variables all have the same
  118. structure. The basic notion is that SRE-Filter will take the server port, and
  119. the server's host nickname, and attempt to find matching COMMONLOG (and
  120. COMBINEDLOG, BROWSERLOG and REFERERLOG) variables.  If a match is not found, 
  121. the "default" variables are used.
  122.  
  123. You should set these stem variable to equal filenames. If you use a
  124. relative file name (i.e.; FOO.BAR or DIR1/FOO.BAR), the file is
  125. assumed to be relative to the DATA\ subdirectory of the GoServe
  126. working directory.
  127.  
  128. Some examples should help.  These examples use COMMONLOG,
  129. but the logic is exactly the same for COMBINEDLOG, BROWSERLOG and REFERERLOG.
  130.  
  131. For these examples, assume the following entries in SREFLOGS.INI
  132. (also assume that the DATA\ subdirectory is D:\GOSERVE\DATA)
  133.  COMMONLOG='COMMON.LOG'
  134.  COMMONLOG.CIRCUS.8080='CIRCUS\COMMON.8080'
  135.  COMMONLOG.ZOO='D:\CIRCUS\WWW\COMMON.LOG'
  136.  
  137. Example 1: if the server is a single host (no host nicknames specified)
  138. on the standard port (80), then SRE-Filter would look for:
  139.    COMMONLOG.80         -- this is the first variable looked for
  140.    COMMONLOG            -- the default
  141. Since COMMONLOG.80 was not specified, COMMONLOG is used (which yields a
  142. value of D:\GOSERVE\DATA\COMMON.LOG).
  143. Note that this example also applies to non-standard ports on single
  144. host systems (with the .80 changed appropriately).
  145.  
  146. Example 2: port 80, host nickname of ZOO:
  147.    COMMONLOG.ZOO.80    -- this is the first variable looked for
  148.    COMMONLOG.ZOO       -- this is the second variable looked for
  149.    COMMONLOG           -- this is the default
  150. COMMONLOG.ZOO.80  was not specified, but COMMONLOG.ZOO was. Thus,
  151. the value will be D:\CIRCUS\WWW\COMMON.LOG.
  152.  
  153. Example 3: port 8080, "host nickname" of CIRCUS:
  154.    COMMONLOG.CIRCUS.8080   -- this is the first variable looked for
  155.    COMMONLOG.CIRCUS        -- this is the second variable looked for
  156.    COMMONLOG               -- this is the default
  157. Since COMMONLOG.CIRCUS.8080 exists; so the value will be
  158. D:\GOSERVE\DATA\CIRCUS\COMMON.8080  (D: must be an HPFS drive).
  159.  
  160. If the desired default is to not record, set COMMONLOG=0.  Note that
  161. you can override this default on a host-nickname/port specific basis.
  162.  
  163. As stated above, the COMBINEDLOG, BROWSERLOG and REFERERLOG variables are 
  164. treated the same way. Thus, to suppress the REFERERLOG, set REFERERLOG=0 
  165. (and have no other REFERERLOG. variables).
  166.  
  167. C.2) The NOxxx, SCHED., and other options  --------------------------------------
  168.  
  169. The followings options allow you to modify the output to the common-log file,
  170. and to suppress the recording of selected requests.
  171.  
  172.  
  173. APACHE_MODE:
  174.   If APACHE_MODE=1, then the referer and browser log's are written using
  175. an "Apache" mode (that is, something similar to what Apache server's write).
  176. If APACHE_MODE=0, then a "GoHTTP" mode is used.
  177.  
  178. For example:
  179. APACHE_MODE (browser and referer logs):
  180.   [14/Mar/1996:17:45:08] Mozilla/2.0 (X11; I; HP-UX A.09.05 9000/735)
  181.   [14/Mar/1996:17:48:10] http://guide-p.infoseek.com/Titles -> /~sret1/analog/
  182. GoHTTP:
  183.   [03/Jun/1997:19:35:16 -0500] DAL40-29.PPP.IADFW.NET Mozilla/2.02E (OS/2; I)
  184.   [2/Mar/1997:18:23:37 -0500] "/imgs/srefiltr.gif" http://ship.float.net/
  185.  
  186.  
  187. FORCE_REFERER:
  188. If FORCE_REFERER=1, then in cases where there is no referer,
  189. a " - " is used.
  190.  
  191.  
  192. NOOPTIONS:
  193.   If NOOPTIONS=1, then the portion of the request selector following a ?
  194.   will not be included.  Since this can be quite long (as when you are
  195.   using the GET method in an HTML FORM), inclusion of this information can
  196.   lead to very long (and hard to read) entries.
  197.   For example: given a request for: /LOOK1?arg1=sub1/&arg2=1&argx=1&xmac=0
  198.                if NOOPTIONS=1, the "request" portion of the common-log (and
  199.                referers log) will be /LOOK1
  200.  
  201. NOHTTP
  202.   Technically, a request string should end with the HTTP version.
  203.   Since this is almost always HTTP/1.0, and since it's not clear that
  204.   the common-log format requires this information, you can suppress this
  205.   portion of the request string by setting NOHTTP=1.
  206.  
  207. NOCODES
  208.    NOCODES should contain a space delimited list of  3 digit
  209.    "return status codes" that you do NOT want to record. For example,
  210.    you may not be interested in requests that generated a "authorization
  211.    response" (a 401 response). If so, set:
  212.        NOCODES='401 '
  213.    If you are also uninterested in "moved" responses, you can set:
  214.        NOCODES='401 301 302 '
  215.    And if you are sort of perverse, and are not interested in normal
  216.    responses, you can set:
  217.        NOCODES='200 '
  218.  
  219.    If a request selector matches one of these NOCODES, then none of the log
  220.    files are written to.
  221.  
  222.  
  223. NOUSER
  224.    This should contain a space delimited list of IP names (or numeric
  225.    addresses for those clients with no IP name) that you do NOT wish to record.
  226.    It can also contain "usernames" (from SRE-Filter's USERS.IN
  227.    usename/password database).
  228.    That is, requests from these addresses (and from these "users") will NOT be
  229.    recorded.  One sensible use of this is to include OWNER's IP address
  230.    (since you probably don't care about requests you make to yourself), as
  231.    well as the "usernames" of the various SUPERUSERs.
  232.    Note that if you take this suggestion, you must put in the OWNER's IP
  233.    name (in contrast, the SRE-Filter OWNERS variable expects a numeric
  234.    IP address).
  235.  
  236.    Example: NOUSER=' joe.bars.net *.wah.com 151.121.55.6  ADMINX '
  237.  
  238.    Notes:
  239.      * you can use * as a wildcard for a field. Thus, ab.wah.com
  240.        and cd.wah.com would both match *.wah.com, but www.ef.wah.com would
  241.        NOT.
  242.     * If 151.121.55.6 has an IP name of jill.money.gov,
  243.       she would NOT match 151.121.55.6 -- 151.121.55.6 would only match
  244.       if there was NO ip name available.
  245.     * ADMINX is a possible "username" (possibly of a SUPERUSER).
  246.     * If a match to any of these NOCODES occurs, then none of the log files
  247.       are written to.
  248.  
  249. NOREFERER
  250.    This should contain a space delimited list of IP names (or numeric
  251.    addresses for those clients with no IP name) that you do NOT wish to record
  252.    in the REFERER.LOG file.
  253.    That is, requests that were refered from these addresses will NOT be
  254.    recorded in REFERER.LOG.  However, these requests WILL be recorded in the 
  255.    common.log, combined.log, and browser.log files.
  256.  
  257.  
  258.    Example: NOREFERER=' *.my.site.net  backup.site.org '
  259.  
  260.    Notes:
  261.      * you can use * as a wildcard for a field. Thus, ab.wah.com
  262.        and cd.wah.com would both match *.wah.com, but www.ef.wah.com would
  263.        NOT.
  264.     * If 151.121.55.6 has an IP name of jill.money.gov,
  265.       she would NOT match 151.121.55.6 -- 151.121.55.6 would only match
  266.       if there was NO ip name available.
  267.  
  268.  
  269.  
  270.  
  271. NOURL.1
  272. ..
  273. NOURL.n
  274.    The NOURL. entries should contain URLs to NOT record. That is, if a request
  275.    selector matches one of these URLs, it will NOT be recorded.
  276.    For example:
  277.         NOURL.1 = 'IMGS/*
  278.         NOURL.2 = 'BORING/TEDIOUS.HTM '
  279.  
  280.    Notes:
  281.     *  You can include * as a wildcard. Thus, IMGS/HORSE.GIF
  282.        matches NOURL.1, and such requests would NOT be recorded
  283.        the common-log, etc. audit files.
  284.     *  These entries are NOT sensitive to host or port -- all
  285.        NOURL entries will apply to all hosts and ports (perhaps
  286.        we'll fix this up if there's enough demand).
  287.     *  If a request selector matches one of these NOURL. variables, then none
  288.        of the log files are written to.
  289.     *  The several SRE-Filter hit suppresion options (such as
  290.        HIT_OWNER_SUPPRESS, have NO effect on these audit files).
  291.     *  \ are converted to /, and leading / are stripped.
  292.  
  293.  
  294. SCHED.1
  295. ..
  296. SCHED.n
  297.   The SCHED. entries  are used to specify programs to run on a scheduled basis.
  298. Each SCHED. entry should contain a "frequency", followed by the fully-qualified name 
  299. of a REXX program to run. For example:
  300.    SCHED.1='DAILY D:\GOSERVE\RENLOGS.CMD  '
  301.  
  302.   The following "frequencies" can be used:
  303.       HOURLY -- run in at nn:01 (nn=0..23)
  304.         DAILY -- run it at midnight (12:01 AM)
  305.       WEEKLY -- run it Sunday at 12:01 AM
  306.     MONTHLY -- run it at 12:01 on the first day of a month
  307.   Note that the moment of execution is approximate, but will generally be within a few minutes
  308.   of the noted time.
  309.  
  310.   Notes:
  311.      * If you do not need to run scheduled programs, set SCHED.1=0
  312.      * Scheduled programs will be called without arguments, but will have access to the
  313.        SRE-Filter environment variables.
  314.      * The RENLOGS.CMD file is an example of such a scheduled event program -- it will
  315.         archive the various log files on a scheduled basis (see RENLOGS.CMD for details).
  316.      * OPTIONAL: You can have an argument list after the fully qualified name.
  317.         For example: SCHED.2='WEEKLY D:\GOSERVE\FOOBAR.CMD Weekly_Update '
  318.        This argument list will be sent (as one argument!) to the called program.
  319.  
  320.  
  321. -------------------------------------------------
  322. D) Structure of .LOG files
  323.  
  324.  
  325. i) The common-log file format -------------------
  326.  
  327. (the following description is adapted from
  328.   http://www.apache.org/docs/mod/mod_log_common.html)
  329.  
  330. The common-log file contains a separate line for each request.
  331. A line is composed of several items (tokens) separated by spaces:
  332.      host ident authuser date request status bytes
  333. If a token does not have a value then it is represented by a hyphen (-).
  334.  
  335. The meanings and values of these tokens are as follows:
  336.  
  337. client
  338.   The fully-qualified domain name of the client, or its IP number if the
  339.   name is not available.
  340. ident
  341.    The identd identity information: NOT SUPPORTED BY SRE-FILTER.
  342. authuser
  343.    The client's username, as provided in the AUTHORIZATION request header.
  344.    Note that the common-log standard suggests that "if the request was for a
  345.    password protected document, then this is the userid used in the request".
  346.    However, SRE-Filter will always include the authuser (if available), even
  347.    if the particular request did not require authorization.
  348. date
  349.    The date and time of the request, in the following format:
  350.       date = [day/month/year:hour:minute:second zone]
  351.    where:
  352.          day = 2 digit
  353.          month = 3 letter
  354.          year = 4 digit
  355.          hour = 2 digit
  356.          minute = 2 digit
  357.          second = 2 digit
  358.          zone = (`+' | `-') 4 digit
  359. request
  360.      The request line from the client, enclosed in double quotes
  361. status
  362.    The three digit status code returned to the client.
  363. bytes
  364.    The number of bytes in the object returned to the client, not including
  365.    any headers.
  366.  
  367. For example:
  368.  acl.wear.org - - [18/Mar/1996:16:24:08 -0500] "GET /SMP/HLO.HTM HTTP/1.0" 200 1251
  369.  
  370. In the above example, the HTTP/1.0 substring may not be standard (you can
  371. suppress it by setting the NOHTTP option in SREFLOGS.INI). Also note that
  372. -0500 corresponds to the EST offset from GMT.
  373.  
  374. ii) The BROWSERS log file ---------------------
  375.  
  376. The browsers log file has the following structure:
  377.    [date] client : user-agent
  378. For example:
  379.   [24/Feb/1997:18:14:30 -0500] 151.121.65.143 : IBM-WebExplorer-DLL/v1.1b
  380.  
  381. iii) The REFERERS log file ----------------------
  382.  
  383. The referers log file has the following structure:
  384.    [date]  "sel"  referer_url
  385. Where SEL is from the request string, and the referer_url is from the
  386. REFERER request header.
  387. For example:
  388.    [24/Feb/1997:18:18:19 -0500] "/SAMPLES/samp1.htm" http://dh.ag.gov/i.htm
  389. (http://dh.ag.gov/i.htm contained a link to /samples/samp1.htm)
  390.  
  391. Note: if a request does not have a REFERER request header (for example, WebEx
  392. does not provide a REFERER request header):
  393.   if FORCE_REFERER=0, an entry will NOT be added to the   REFERERS log.
  394.      FORCE_REFERER=1, a referer of " - " is used.
  395.  
  396. iv)The COMBINEDLOG log file
  397.  
  398. The  combined log file combines the common, referer, and browser logs.
  399. It has the following structure:
  400.   PARROT.HALL.NET - - [04/Jun/1997:22:38:16 -0400] "GET /imgs/justscal.gif"
  401.   200 516 "http://mysite.heights.edu/SAMPLES/guide.htm"
  402.   "Mozilla/2.02E (OS/2; I)"
  403. (but all on one long line).
  404.  
  405.  
  406. -- End of documentation.
  407.