Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > System > Logging

    logator 0.2.2

    Download button

    No screenshots available
    Downloads: 119  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Mathieu Lecarme | More programs
    MIT/X Consortium Lic... / FREE
    February 26th, 2012, 14:14 GMT
    ROOT / System / Logging

     Read user reviews (0)  Refer to a friend  Subscribe

    logator description

    Build your own log parser

    logator is a tool that allows you to build your own log parser.

    Installing it

    python setup.py build
    sudo python setup.py install


    Using it

    You need a source. Something wich iterate log line. The simplest way is STDIN and files, but you can also use syslogd protocol or more complex source.

    For reading loglines, you need a reader. Reader is basically a regex with simple string manipulations. You can add dynamic getter for castly query (ip to country for example). Dynamic attributes are lazy loaded and memoized.

    Query is done with filter, wich can be piped.

    Result can be return as dict wich can be easily serialized if you wont to index it or storing it.

    from logator.log import log
    from logator.weblog import Common, UserAgent, HostByName, Filter_by_code, Filter_by_attribute
    #The filter
    filtr = Filter_by_code(200) | Filter_by_attribute('command', 'GET')
    #The source
    logs = open('/var/log/apache2/access.log', 'r')
    #Lighttpd is the reader with two dynamic attributes reader : UserAgent, HostByName
    for line in filtr.filter(logs, Lighttpd, UserAgent, HostByName):
     print line.as_dict()


    User Agent parsing is stolen from Google code: http://code.google.com/p/ua-parser/.


    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    log parser | parse logs | log | parser | logging

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM