As you may recall, there are only two configuration files for LoggerFS: logs.xml and schemas.xml. These configuration files are stored in /etc/loggerfs; the binaries are stored in /usr/local/bin.
Let's create these files from scratch for practice. Either delete or zero the existing configuration files:
We'll start with logs.xml. RHEL5 stores Apache log files in /var/log/httpd and all Log paths in httpd.conf are relative to that path, so we'll set the log file location to simply access_log. Apache by default (at least in RHEL5) uses combined format, so we'll call our schema apache_combined. Since the apache server will need permission to write to these log files, we'll trust that the user apache and anyone in the apache group with write permissions by settings <permissions> to 0220. Obviously we're using MySQL for our LAMP server, so we'll say MySQL is listening on localhost and on the default port (3306). Finally, we set the database, username, and password to match what we created when setting up MySQL:
Onto schemas.xml. When creating this file, it's important to consider the data you're trying to log; for example, here's an apache line in Combined Format:
First, we identify what parts of the line are important to us; what do we want to log? Then we write our regular expression out and give each match a column name. For our LAMP server, the following will suffice as a regular expression:
Now we'll name each match of the regular expression. These names will become the column names of the accessLogs table (specified above in logs.xml).
We've already named this schema apache_combined in the logs.xml, so we have everything we need to create our schemas.xml file:
Post new comment