# Example logfeed Config File # =========================== # Required Configuration # ---------------------- # The location of the log file. $log_file = '/var/log/httpd/access.log'; # The title of the feed. $feed_title = 'Recent Referrers'; # The base URL for the site (with no trailing slash): $base_url = 'http://foo.net'; # The path to the feed, so that $base_url$feed_path gives the complete URL. $feed_path = '/feeds/referrers.atom'; # The author's name. $author_name = 'Author Name'; # The year this feed was started or the year you obtained your domain name. # This is used to construct a unique Atom feed ID. See # http://www.taguri.org/ for details. $id_year = '2008'; # Optional Configuration # ---------------------- # # All of the following are optional. # # The number of entries to include. Defaults to 50. #$num_entries = 25; # Set to 1 to enable reverse DNS lookup and to 0 otherwise. Defaults to 0. #$reverse_dns = 1; # A short description of the feed. #$feed_subtitle = 'A list of recent referrers.'; # The URL of the feed's icon #$feed_icon = 'http://foo.net/favicon.ico'; # The author's email #$author_email = ''; # The author's URI #$author_uri = ''; # Entry Template # -------------- # # Custom entry body template. If you do not define this variable, the # default template will be used. The variable $entry is a string containing # the template for generating items in the Atom feed. You need to # use single quotes (or qw) so that the variables don't interpolate. # # If you modify the default template, make sure the body of the # element is valid XHTML and that the required elements, , , and # <updated> are all included. It is very important that the IDs are unique. # # The following variables will be interpolated using information # from the log file: # # * $ip - IP address # * $host - hostname when reverse DNS is enabled, ip otherwise # * $user - authenticated username # * $time - time from log # * $utc_time - UTC formatted time # * $id_time - The UNIX time of the log entry # * $req - the request filename # * $code - status code # * $sz - file size # * $ref - referring URL # * $short_ref - referrer without CGI parameters # * $ua - User agent # # And the following will be interpolated based on the metadata defined # above: # # * $log_file - Path to the Apache access log # * $feed_title - The title of the overall feed # * $base_url - The base url of the site # * $feed_path - The absolute path to the feed # * $id_year - Your chosen identifying year # * $id_domain - Your domain # # Here is the default template: # # $entry = '<entry> # <id>tag$colon$id_domain,$id_year$colon$feed_path/$id_time/$ip$req</id> # <title>$host: $req # # $author_name # $author_uri$author_email # # $utc_date #
#
    #
  • Date: $utc_date
  • #
  • User: $user
  • #
  • Host: $host
  • #
  • User Agent: $ua
  • #
  • Referrer: $ref
  • #
  • File: $base_url$req
  • #
  • Size: $sz
  • #
  • Status: $code
  • #
#
#
# #
# '; # Filtering # --------- # # You can match or ignore lines using the %match and %ignore hashes # with the following keys: # # * 'ip' - IP address # * 'user' - Username (if authenticated) # * 'req' - Request filename # * 'code' - Status code # * 'ref' - Referring URL # * 'ua' - User agent string # # Values in these hashes should consist of regular expressions. # Lines that match _at least one_ of the %ignore rules will be excluded. # Remaining lines that match _all_ of the %match rules for each key # will be included. This is perhaps best illustrated with an example. # # The following rules will create a feed of all requests with referring # URLs containing ('google' OR 'yahoo') AND result in a 404 code: # # $match{'ref'} = 'google|yahoo'; # $match{'code'} = '404'; # # Below are some more examples: # # * Match hits coming from Wikipedia: # # $match{'ref'} = 'wikipedia\.org'; # # * Ignore hits on files in /css and /code: # # $ignore{'req'} = '^/css|^/code'; # # * Match requests for the feeds index.atom and index.rss: # # $match{'req'} = '^index\.atom$|^index\.rss$'; # # * Ignore Googlebot and Yahoo! Slurp: # # $ignore{'ua'} = 'slurp|googlebot'; # # * Match Internet Explorer users: # # $match{'ua'} = 'MSIE'; # # * Since the configuration file is just Perl code, you can even do things # like the following, which ignores hits with no referring URL and hits from # Google and Yahoo: # # my @temp = qw! ^-$ google\.com ^http://search\.yahoo\.com !; # $ignore{'ref'} = join '|', @temp;