summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f418da5)
raw | patch | inline | side by side (parent: f418da5)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 19 Mar 2008 14:19:40 +0000 (14:19 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 19 Mar 2008 14:19:40 +0000 (14:19 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9940 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/tests/log-parser.pl | patch | blob | history |
index f888bb610f0e71572263279529bca211215c7151..c5ec45badd0ec01e55eab1efbca10beeefe25a33 100755 (executable)
use strict;
use warnings;
use Getopt::Long;
+use Data::Dumper;
my $log_file = "/var/log/gosa-si-server.log";
my $within_session = 0;
sub check_header {
my ($line) = @_ ;
- my @line_list = split(" ", $line);
# new header, set all values back to default
if ($line =~ /INFO: Incoming msg with header/ ) {
$within_header = 1;
return $line;
} else {
- if ($within_header) {
- return $line;
- } else {
- return;
- }
+ if ($within_header) { return $line; }
}
+ return;
}
sub check_incoming {
my ($line) = @_ ;
- my @line_list = split(" ", $line);
# new incoming msg, set all values back to default
if ($line =~ /INFO: Incoming msg with session ID \d+ from/ ) {
$within_incoming = 1;
return $line;
} else {
- if ($within_incoming) {
- return $line;
- } else {
- return;
- }
+ if ($within_incoming) { return $line; }
}
+ return;
}
sub check_session {
my ($line) = @_ ;
- my @line_list = split(" ", $line);
- if (not $line_list[4]) {
- if ($within_session) {
+ if ($line =~ /gosa-si-server (\d+) / ) {
+ if ((defined $1) && ($1 eq $session)) {
+ $within_session = 1;
return $line;
- }
- return;
- }
-
- if($line_list[4] eq $session) {
- $within_session = 1;
- return $line;
+ } else { $within_session = 0; }
} else {
- $within_session = 0;
+ if ($within_session == 1) { return $line; }
}
return;
}
+
+
### MAIN ######################################################################
GetOptions(
if ($line =~ /INFO: Incoming msg with session ID \d+ from / ) {
if ($positive_msg) {
print join("\n", @lines)."\n";
- $positive_msg = 0;
}
+ $positive_msg = 0;
$within_session = 0;
$within_header = 0;
$within_incoming = 0;