GithubHelp home page GithubHelp logo

bheiskell / logolas Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 280 KB

Logolas is a light-weight multi-file log scraper with an accompanying real-time web interface.

License: MIT License

Python 81.14% JavaScript 18.86%

logolas's Introduction

Logolas

Logolas is a light-weight multi-file log scraper with an accompanying real-time web interface.

Screenshot

images/screenshot.png

Design

  • Logolas utilizes inotify to watch files for updates. This means it will not work on Windows or over NFS.
  • Lines are scraped using regular expressions. At a minimum, each line must include a date/time.
  • The scraped lines are persisted to a SQL backend. This addresses loss of historical data due to log rotation. However, currently purging is not automatic.
  • Web interface performs standard polling at a configurable rate.

Features

  • Multi-file logging
  • Multi-regular expression scraping per-file
  • Real-time streaming of logged events
  • Filtering on any matched field
  • Access to historical data (admittedly a bit awkward)

Limitations

  • Cannot parse timezones currently.

Why?

An administrator of my Minecraft server needed a web interface that provided real-time access to information stored in multiple log files on my server.

This started as a toy project, but I've decided to publish it as I can imagine there is someone out there who would benefit from this work.

Installation

The following instructions assumes a debian based distribution.

Using virtual environments:

git clone https://github.com/bheiskell/logolas.git
cd logolas
sudo aptitude install python-virtualenv
virtualenv --no-site-packages venv
. venv/bin/activate
easy_install .
cp sample/config.yml .

To start the log scraper:

cd logolas
. venv/bin/activate
logolas config.yml

Alternatively, deploy to the root python installation:

git clone https://github.com/bheiskell/logolas.git
cd logolas
sudo easy_install .
cp sample/config.yml .
logolas config.yml

Web

To launch the web interface, run:

cd logolas
. venv/bin/activate
export LOGOLAS_CONFIG=config.py
logolas_web

If you plan on using SQLite, make sure you provide a fully qualified path to the database. The Flask framework changes the current working directory which will cause relative paths to break.

TODO: wsgi configuration

MySQL

If you choose to use MySQL with virtual environments, you'll need to install libmysqlclient-dev and python-dev with aptitude. Then you can easy_install mysql-python.

Alternatively, you should be able to simply install to python-mysqldb if you're not using virtual environments.

logolas's People

Contributors

bheiskell 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.