Ulrich Kautz

NAME

Mail::Decency::LogParser

SYNOPSIS

    use Mail::Decency::LogParser;
    
    my $syslog_parser = Mail::Decency::LogParser->new( {
        config => '/etc/decency/log-parser.yml'
    } );
    
    $syslog_parser->run;

DESCRIPTION

The LogParser server provides tools to tail and parse mail server log files. It can implement different log parser styles. For now it supports only postfix log files via Mail::Decency::LogParser::Core::PostfixParser.

CONFIG

Provide either a hashref or a YAML file.

Example:

    ---
    
    include:
        - logging.yml
        - database.yml
        - cache.yml
    
    syslog:
        style: Postfix
        file: /var/log/mail.log
    
    parser:
        -
            Stats:
                disable: 0
                use_date_interval: 1
                intervals:
                    - 10
                    - 600
                    - 86400
                
                csv_log:
                    file: /var/spool/decency/logs/csv
                    classes:
                        - total_reject
                        - connections
                        - sent
                        - deferred
        -
            Aggregator:
                disable: 0
                interval_formats:
                    - 'year-%Y'
                    - 'week-%Y-%U'
                    - 'month-%Y-%m'
        -
            GeoSource:
                disable: 0
                interval_formats:
                    - 'year-%Y'
                    - 'week-%Y-%U'
                    - 'month-%Y-%m'
                enable_per_recipient: 1
    

CLASS ATTRIBUTES

See Mail::Decency::Policy::Core

syslog_file : Str

Path to the syslog file

syslog_socket : Str

Path to socket for syslog

syslog_file : Str

Path to the syslog file

METHODS

init

Loads LogParser modules, inits config, cache and databases

init_syslog_parser

start

Starts all POE servers without calling the POE::Kernel->run

run

Start and run the server via POE::Kernel->run

handle

Handle method, called by the POE::Wheel::FollowTail instance on each tailed line.

AUTHOR

Ulrich Kautz <uk@fortrabbit.de>

COPYRIGHT

Copyright (c) 2010 the "AUTHOR" as listed above

LICENCSE

This library is free software and may be distributed under the same terms as perl itself.