summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 873a283)
raw | patch | inline | side by side (parent: 873a283)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 26 Mar 2008 16:20:18 +0000 (16:20 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 26 Mar 2008 16:20:18 +0000 (16:20 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10003 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/tests/log-parser.pl | patch | blob | history |
index 6158e87f2bc264032d7f57199037b12c5f776162..6b9e6c2dbd0f3e4e05c1a8f47745b21061b09ac5 100755 (executable)
use Getopt::Long;
use Data::Dumper;
-my $log_file = "/var/log/gosa-si-server.log";
+my $log_file = "/home/hickert/log.gosa-si-server";
+#my $log_file = "/var/log/gosa-si-server.log";
my $within_session = 0;
my $within_incoming = 0;
my $within_header = 0;
my $session;
my $incoming;
my $header;
+my $syslog_state;
+
+sub check_syslog_state {
+ my ($line) = @_ ;
+ if($line =~ /$syslog_state:/ ) {
+ return $line;
+ }
+ return;
+}
sub check_header {
my ($line) = @_ ;
"s|session=s" => \$session,
"i|incoming=s" => \$incoming,
"h|header=s" => \$header,
+ "l|log=s" => \$syslog_state,
);
# check script pram
if (defined $header) {
print "header: $header\n";
$script_pram->{'header'} = $header;
-}
+}
+if (defined $syslog_state) {
+ print "syslog_state: $syslog_state\n";
+ $script_pram->{'syslog_state'} = $syslog_state;
+}
if (keys(%$script_pram) == 0) {
# print usage and die
# start of a new message, plot saved log lines
if ($line =~ /INFO: Incoming msg with session ID \d+ from / ) {
if ($positive_msg) {
+ print "#####################################################\n";
print join("\n", @lines)."\n";
}
my $l = &check_header($line);
if (defined $l) { $positiv_counter++; }
}
+
+ elsif ($pram eq 'syslog_state') {
+ my $l = &check_syslog_state($line);
+ if (defined $l) { $positiv_counter++; }
+ }
}
if (keys(%$script_pram) == $positiv_counter) {