This implementation of an NCSA Common and NCSA Combined log file parser is intended to accompany the Safari Books Online blog series High-performance Log Parsing in Haskell (part 1 and part 2).
This code is provided under a BSD3 open source license and forking and modifying of this library to suit your purposes is encouraged.
There are a couple of pre-installation steps that vary depending on your platform.
- Install the OS X GHC and Cabal
- Install the PCRE library:
?> brew install pcre
- Install the linux GHC and Cabal
- Install the PCRE library:
?> sudo apt-get install libpcre3-dev
Once these platform-specific steps are done, you can use cabal, Haskell's package management and build system to do the rest. Run cabal commands from the root directory of the project after you clone it from GitHub. Begin by installing the project's dependencies and setting up a cabal sandbox:
?> cd /path/to/repo/checkout/ncsa-logparse ?> cabal sandbox init # Initialize a cabal sandbox ?> cabal update # This will download the most recent list of packages. ?> cabal install --only-dependencies # Install the project's dependencies
The install step will take a some time as all dependencies are bing downloaded and compiled. When that step is complete, you can build the project:
?> cabal build
This project builds an executable called ncsa-logparse
that will be located in the dist/build/
directory which the build step creates.
The project includes a test suite. The command cabal test
will run the suite and output the results.