Giter VIP home page Giter VIP logo

syslog-viewer's Introduction

What's it?

syslog-viewer is a tail-like command line tool to list events from a MySQL database populated with rsyslog.

Purpose

When administering anything larger than a small server administrators benefit greatly from a centralized log solution. In the open source world syslog/rsyslog is the usual answer, and a database backend like MySQL an important performance consideration.

Such a setup brings out the problem of presenting the data. There are dozens of solutions around, both free and commercial, but they either are expensive, or are difficult to configure, or have a disappointing usability.

And yet, many times, the administrator only wants to have the power of tail again. syslog-viewer is just that, with the ability to poll the database continuously (like tail's -f) and filter events by a variety of conditions.

Installing

syslog-viewer is a single Ruby script. To use it make sure your system has Ruby 1.9 installed, copy syslog-viewer.rb anywhere you like and run:

    $ ruby syslog-viewer.rb -h

Examples

Connect to database Syslog at example.org, using username joe and password 123, and list last 10 events:

    $ ruby syslog-viewer.rb -c joe:[email protected]/Syslog

Filter last 100 events with severity warning or greater, and then follow new events:

    $ ruby syslog-viewer.rb -c joe:[email protected]/Syslog -s WAR -n 100 -f

Filter events happened between 2013-01-01 0:00:00 and 2013-01-01 2:30:00:

    $ ruby syslog-viewer.rb -c joe:[email protected]/Syslog -p "2013-01-01 0:00:00,2013-01-01 2:30:00"

Filter the last 20 events happened before 2013-02-04 0:00:00:

    $ ruby syslog-viewer.rb -c joe:[email protected]/Syslog -p "20,2013-02-04 0:00:00"

It's possible to store common options in ~/.syslog-viewer: it's a YAML file. The syntax is exactly the same as in the command line:

    example:
      connection:
        host: example.org
        port: 3306
        username: joe
        password: '123'
        database: Syslog
      count: 100
      severity: WARNING

You can then invoke those options by the corresponding label (each label can have its own group of options):

    $ ruby syslog-viewer.rb -f example

Note: if you specifiy a label in the command line it must be the last option!

Additional help

Check the Wiki.

License

syslog-viewer is released under the MIT License.

syslog-viewer's People

Contributors

romuloceccon avatar

Stargazers

 avatar  avatar

Watchers

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