ApaLogFilter is a tool - released under the GNU General Public License - which filters and manipulates web server logfiles (NCSA Combined Log Format). The purpose is
The script, config file and documentation are packed into one tarball.
ApaLogFilter-0.99.010.tar.gz
The program needs the following arguments:
Call ........: >>--- ApaLogFilter.pl --- -in FILE --- -out FILE ---> >--- -exf FILE --->< Sample ......: ApaLogFilter.pl -in access.log -out access.log.mod -exf access.log.err Arguments ...: -in FILE Full qualified name of the logfile to process. -out FILE Full qualified name of the ResultFile. -err FILE Fill qualified name of the Exceptionfile.
Modifiy ApaLogFilter.cfg to fit your environment:
############################################################################### ## ## ## A P A L O G F I L T E R . C F G ## ## ## ############################################################################### #+----------------------------------------------------------------------------+ #| Instructions for handling the "status" field. | #+----------------------------------------------------------------------------+ Status.1.Value = 302 Status.1.Action = REPLACE_VALUE Status.1.NewValue = 200 #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- Status.2.Value = 403 Status.2.Action = FORCE_RECORD_IN_EXCEPTION_LIST #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- Status.3.Value = 404 Status.3.Action = FORCE_RECORD_IN_EXCEPTION_LIST #+----------------------------------------------------------------------------+ #| Instructions for handling the "remotehost" field. | #+----------------------------------------------------------------------------+ RemoteHost.1.Value = proxy[0-9]+\.sap-ag\.de RemoteHost.1.Action = EXCLUDE_RECORD #+----------------------------------------------------------------------------+ #| Instructions for handling the "request-URL" field. | #+----------------------------------------------------------------------------+ RequestUrl.1.Title = /Index.htm RequestUrl.1.Value.1 = /html/s00c000m\.htm RequestUrl.1.Type.1 = STRING ##### -- ##### Means, that "/html/s00c000m.htm" is matched and ##### replaced by "/Index.htm" (for the output) #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- RequestUrl.2.Title = /Gallery/Index.htm RequestUrl.2.Value.1 = /html/s01c000m\.htm RequestUrl.2.Type.1 = STRING #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- RequestUrl.3.Title = /Gallery/Schottland.htm RequestUrl.3.Value.1 = /html/s01c800b\.htm RequestUrl.3.Type.1 = STRING #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- RequestUrl.4.Title = /Gallery/BigPic/$FILE RequestUrl.4.Value.1 = /cgi-bin/p9\.pl\?STYLE=1&FILE=/pics/f[0-9][0-9][0-9]n[0-9][0-9]b\.jpg RequestUrl.4.Type.1 = REGEXP RequestUrl.4.Value.2 = /cgi-bin/p9\.pl\?STYLE=1&FILE=/pics/fp[0-9][0-9][0-9][0-9]b\.jpg RequestUrl.4.Type.2 = REGEXP ##### -- ##### Means, that e.g. "/cgi-bin/p9.pl?STYLE=1&FILE=/pics/f042n42b.jpg" is matched and ##### replaced by "/Gallery/BigPic/f042n42b.jpg" (for the output) #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- RequestUrl.5.Title = $ALL RequestUrl.5.Value.1 = /favicon.ico RequestUrl.5.Type.1 = STRING ##### -- ##### Means, that "/favicon.ico" is matched and ##### "/favicon.ico" also will be used for output. #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- #... #+----------------------------------------------------------------------------+ #| Instructions for handling the "referred-URL" field. | #+----------------------------------------------------------------------------+ ReferredUrl.1.Value = http://www.scheibli.com ReferredUrl.1.Action = REPLACE_WITH_BLANK #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- ReferredUrl.2.Value = http://sites.inka.de/scheibli ReferredUrl.2.Action = REPLACE_WITH_BLANK
In case you have comments, added functionality or found a bug, please feel free to contact me.