Updated Logwatch 'SearchDate' custom script. Renamed it.

Updated notes in LogFile config.
This commit is contained in:
Asif Bacchus
2018-09-26 22:54:14 -06:00
parent 9ba6b40904
commit 47acc2684c
2 changed files with 10 additions and 5 deletions
@@ -5,14 +5,16 @@
##########################################################################
###############################################################################
## Filter dates in full-date-time international format
## Format: '%Y-%m-%d %H:%M:%S'
## Filter dates in full-date-time international format, surrounded by square
## brackets located anywhere on a given line
## Format: '[%Y-%m-%d %H:%M:%S]'
###############################################################################
use Logwatch ':dates';
my $Debug = $ENV{'LOGWATCH_DEBUG'} || 0;
### Specify the format of the date/time stamp itself
$SearchDate = TimeFilter('%Y-%m-%d %H:%M:%S');
if ( $Debug > 5 ) {
@@ -21,7 +23,8 @@ if ( $Debug > 5 ) {
}
while (defined($ThisLine = <STDIN>)) {
if ($ThisLine =~ m/^$SearchDate /o) {
### specify the regex that defines how to find 'SearchDate'
if ($ThisLine =~ m/\[$SearchDate\] /o) {
print $ThisLine;
}
}