GithubHelp home page GithubHelp logo

logsandra's Introduction

Logsandra

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.

Requirements

Logsandra works with Cassandra 0.7 or 0.8.

The following Python packages are required:

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

Installation

To install Logsandra run:

pip install -r requirements.txt
python setup.py 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/create_keyspace.py.

Configuration

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.

Usage

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

Usage:

python logsandra-httpd.py [options] start|stop|restart
python logsandra-monitord.py [options] start|stop|restart

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

python logsandra-httpd.py --help
python logsandra-monitord.py --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.

logsandra's People

Contributors

jbohman avatar thobbs avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.