summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e831fa7)
raw | patch | inline | side by side (parent: e831fa7)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 13 Mar 2008 14:19:24 +0000 (14:19 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 13 Mar 2008 14:19:24 +0000 (14:19 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9744 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/tests/log-parser.pl | [new file with mode: 0755] | patch | blob |
diff --git a/gosa-si/tests/log-parser.pl b/gosa-si/tests/log-parser.pl
--- /dev/null
@@ -0,0 +1,51 @@
+#!/usr/bin/perl
+#===============================================================================
+#
+# FILE: log-parser.pl
+#
+# USAGE: ./log-parser.pl
+#
+# DESCRIPTION:
+#
+# OPTIONS: ---
+# REQUIREMENTS: ---
+# BUGS: ---
+# NOTES: ---
+# AUTHOR: (), <>
+# COMPANY:
+# VERSION: 1.0
+# CREATED: 13.03.2008 14:51:03 CET
+# REVISION: ---
+#===============================================================================
+
+use strict;
+use warnings;
+use Getopt::Long;
+
+my $log_file = "/var/log/gosa-si-server.log";
+
+my $session;
+GetOptions("s|session=s" => \$session);
+
+if( not defined $session) { die "\tplease define a session to parse\n\ti.e. 'perl log-parser.pl -s 4'\n" };
+
+print "session: $session\n";
+
+open(FILE, "<$log_file") or die "\t can not open log-file";
+
+# Read lines
+my $line;
+while ($line = <FILE>){
+ next if $line =~ /^\s/;
+
+ chomp($line);
+ my @line_list = split(" ", $line);
+
+ next if not $line_list[4];
+
+ if($line_list[4] eq $session) {
+
+ print "$line\n";
+
+ }
+}