NAME

LogFilter - A simple log filtering module

SYNOPSIS

use LogFilter;

my $filter = LogFilter->new($keywords_file, $exclude_file, $log_file, $interval);

$filter->filter;

DESCRIPTION

The LogFilter module provides an easy way to filter logs based on keywords and exclude words. It continuously reads a log file and prints lines that contain any of the provided keywords but do not contain any of the provided exclude words.

INSTALLATION

You can install this module:

git clone https://github.com/kawamurashingo/LogFilter.git
perl Makefile.PL
make
make test
make install

METHODS

new

Creates a new LogFilter object.

my $filter = LogFilter->new($keywords_file, $exclude_file, $log_file, $interval);

Arguments:

- $keywords_file: a file containing keywords, one per line. - $exclude_file: a file containing words to exclude, one per line. - $log_file: the log file to read. - $interval: the interval at which to read the log file, in seconds.

filter

Starts filtering the log file.

$filter->filter;

This method will keep running until the program is terminated.

AUTHOR

Kawamura Shingo <pannakoota@gmail.com>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.