Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Cassandra demo application, log management
branch: master

This branch is 25 commits ahead of jbohman:master

Failed to load latest commit information.
conf Move .ini and .yaml files into conf/
logsandra Config uses cassandra_host, not cassandra_address
scripts Rename to
.gitignore Remove .egg-info from revision control
LICENSE Add LICENSE and license info to REAMDE.mkd Created a pylon project and merged the code into it.
README.mkd Update README parser example to use add_log() Move .ini and .yaml files into conf/ Add start-fg option to
requirements.txt Add requirements.txt
setup.cfg Created a pylon project and merged the code into it. Remove ordereddict from requirements



Logsandra is a log management application written in Python that uses Cassandra for storage.

The project is open source under the MIT license. See LICENSE for more info.


Logsandra works with Cassandra 0.7 or 0.8.

The following Python packages are required:

* Pylons >= 1.0
* Jinja2
* pycassa >= 0.5.4
* python-dateutil
* CherryPy >= 3.1
* Thrift >= 0.5.0
* Cassandra (not automatically installed during the installation phase)


To install Logsandra run:

pip install -r requirements.txt
python install

All Python modules will be automatically installed by that command except for the Cassandra bindings.

To generate the keyspace and column family needed by logsandra, run scripts/


The main configuration file for Logsandra is logsandra.yaml. Below is a list of configuration variables (including type and optional/required):

ident               identity of the logsandra server [String, Optional/Discovery]

httpd_host          host on which to serve the logsandra web service [String, Required]
httpd_port          port on which to serve the logsandra web service [String, Required]
httpd_config        name of the pylons configuration file [String]

cassandra_host      cassandra host to connect too [String, Required]
cassandra_port      cassandra port to connect too [String, Required]
cassandra_timeout   in seconds until connection is aborted if no response is delivered [String, Optional]

paths               list of paths to monitor [List, Optional]
  path              directory or file [String, Required]
  recursive         recursively enter sub directories [True/False, Optional]
  parser            dictionary containing parser name and arguments [Dictionary, Required]
    name            name of the parser [String, Required]
    ...             arguments, see specific parser [Depends, Optional]

Logsandra is built on Pylons and therefore a Pylons configuration file should be present for Logsandra's web service to work.


Logsandra consists of two main scripts, both of which act as daemons.


python [options] start|stop|restart
python [options] start|stop|restart

If you want a list of options invoke either one these commands:

python --help
python --help

A typical setup is to run logsandra-httpd on one server and logsandra-monitord on all servers producing log files. logsandra-monitord store the logs in the Cassandra cluster.

Create Your Own Parser

You can create your own Logsandra parser by adding a module to the logsandra.monitor.parsers package.

An example parser:

from logsandra.monitor.parsers import BaseParser

class FooParser(BaseParser):
    def parse(self, line, source, data):
        date = None
        keywords = []
        return self.client.add_log(date=date, entry=line, source=source, keywords=keywords)

You should also look at logsandra/monitor/parsers/ for more parser examples.

Something went wrong with that request. Please try again.