PHP Abstract Java 6.0 Features - Scripting Language for the Java Platform
Jun 06

apachelog2feed

If you like to follow everything using your feed reader, you might also want to read your Apache log in feed. Well, you need to try Apache Log Analyzer 2 Feed.

ApacheLogAnalyzer2Feed is an object oriented class, written in PHP 5, for parsing/filtering an Apache log file and convert it into feed.

You can filter out which part of your Apache log you’d like to see. For example, you can generate a feed that shows you when Google Bot visit your blog or when your visitor register, etc. See some sample codes here.

Here’s the sample output from my Apache log,


<rss>
<channel>
<title>Log /usr/local/apache2/logs/access_logs filtered by 1 filters</title>
<description>Array
(
    [0] => Array
        (
            [0] => Request
            [1] => regexp:generator\.php
            [2] => IS
        )

)
</description>
<link>/log.php</link>
<lastbuilddate>Wed, 06 Jun 2007 21:20:08 +0100</lastbuilddate>
<generator>FeedCreator 1.7.2-ppt (info@mypapit.net)</generator>
<item>
<title>192.168.1.99 - GET /generator.php HTTP/1.0</title>
<link>/log.php</link>
<description>Array
(
    [Remote-Host] => 192.168.1.99
    [Remote-Logname] => -
    [Remote-User] => -
    [Time] => [06/Jun/2007:21:17:26 +0700]
    [Request] => GET /generator.php HTTP/1.0
    [Final-Status] => 200
    [Bytes-Sent] => 9274
    [Referer] => -
    [User-Agent] => Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
)
</description>
<pubdate>Wed, 06 Jun 2007 21:17:26 +0100</pubdate>
<guid>b27435fba04c82a72e084d0404bc442b</guid>
</item>
<item>
<title>192.168.1.99 - GET /generator.php HTTP/1.0</title>
<link>/log.php</link>
<description>Array
(
    [Remote-Host] => 192.168.1.99
    [Remote-Logname] => -
    [Remote-User] => -
    [Time] => [06/Jun/2007:21:20:02 +0700]
    [Request] => GET /generator.php HTTP/1.0
    [Final-Status] => 200
    [Bytes-Sent] => 9274
    [Referer] => -
    [User-Agent] => Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
)
</description>
<pubdate>Wed, 06 Jun 2007 21:20:02 +0100</pubdate>
<guid>005091851cf9b076180c57ff3c5ea081</guid>
</item>
</channel>
</rss>

One Response to “Apache Log Analyzer 2 Feed”

  1. Simone Carletti Says:

    Thanks for posting this entry about the class. :)
    I hope you’ll enjoy it.

Leave a Reply

Your Ad Here