Skip to content
NCSA Logfile Parser in Haskell
Haskell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
blog
src
tests
.gitignore
LICENSE
README.rst
Setup.hs
ncsa-logparse.cabal
sample_ncsa_common.log
sample_ncsa_extended.log

README.rst

NCSA Logparser

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.

Getting Started

There are a couple of pre-installation steps that vary depending on your platform.

OS X

  1. Install the OS X GHC and Cabal
  2. Install the PCRE library: ?> brew install pcre

Ubuntu

  1. Install the linux GHC and Cabal
  2. Install the PCRE library: ?> sudo apt-get install libpcre3-dev

Sandbox Setup

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.

Testing

The project includes a test suite. The command cabal test will run the suite and output the results.

You can’t perform that action at this time.