amoralej / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 years ago
Clone

Blame SOURCES/0025-Ticket-47520-Fix-various-issues-with-logconv.pl.patch

ba46c7
From 13d7e670c2bd412a3e1db935e0ba5b4f4d92d900 Mon Sep 17 00:00:00 2001
ba46c7
From: Mark Reynolds <mreynolds@redhat.com>
ba46c7
Date: Mon, 23 Sep 2013 11:32:16 -0400
ba46c7
Subject: [PATCH 25/28] Ticket 47520 - Fix various issues with logconv.pl
ba46c7
ba46c7
Bug Description:  When testing an access log that contains "internal" connections/ops, many
ba46c7
                  warning messages are created.  Other warnings are generated because the
ba46c7
                  DB_File arrays need to have thier elements checked before comparing to other
ba46c7
                  strings.
ba46c7
ba46c7
Fix Description:  Improve value checking.  Add support for connection numbers that are words (Internal),
ba46c7
                  and negative values for op ids(-1).
ba46c7
ba46c7
https://fedorahosted.org/389/ticket/47520
ba46c7
ba46c7
Reviewed by: richm(Thanks!)
ba46c7
(cherry picked from commit 8b153e999ac6dc4869498a78da103a07db49d28e)
ba46c7
(cherry picked from commit 2c5d52b7a4aef8317cc9e34a9b1153c74620010d)
ba46c7
---
ba46c7
 ldap/admin/src/logconv.pl |  201 ++++++++++++++++++++++++--------------------
ba46c7
 1 files changed, 110 insertions(+), 91 deletions(-)
ba46c7
ba46c7
diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl
ba46c7
index ec0fdf5..3a6fa01 100755
ba46c7
--- a/ldap/admin/src/logconv.pl
ba46c7
+++ b/ldap/admin/src/logconv.pl
ba46c7
@@ -102,6 +102,7 @@ my $fdds = 0;
ba46c7
 my $reportBinds = "no";
ba46c7
 my $rootDN = "";
ba46c7
 my $needCleanup = 0;
ba46c7
+my @scopeTxt = ("0 (base)", "1 (one)", "2 (subtree)");
ba46c7
 
ba46c7
 GetOptions(
ba46c7
 	'd|rootDN=s' => \$rootDN,
ba46c7
@@ -653,6 +654,7 @@ print "Entire Search Base Queries:   $objectclassTopCount\n";
ba46c7
 print "Paged Searches:               $pagedSearchCount\n";
ba46c7
 print "Unindexed Searches:           $unindexedSrchCountNotesA\n";
ba46c7
 print "Unindexed Components:         $unindexedSrchCountNotesU\n";
ba46c7
+
ba46c7
 if ($verb eq "yes" || $usage =~ /u/){
ba46c7
 	if ($unindexedSrchCountNotesA > 0){
ba46c7
 		my $conn_hash = $hashes->{conn_hash};
ba46c7
@@ -670,11 +672,12 @@ if ($verb eq "yes" || $usage =~ /u/){
ba46c7
 		my $filter_val = $arrays->{filterval};
ba46c7
 		my $filter_conn = $arrays->{filterconn};
ba46c7
 		my $filter_op = $arrays->{filterop};
ba46c7
-
ba46c7
 		my $notesCount = "1";
ba46c7
 		my $unindexedIp;
ba46c7
+
ba46c7
 		for (my $n = 0; $n < scalar(@{$notesEtime}); $n++){
ba46c7
-			if($conn_hash->{$notesConn->[$n]} eq ""){
ba46c7
+			if(!$notesConn->[$n] || $notesConn->[$n] eq "" || 
ba46c7
+			   !$conn_hash->{$notesConn->[$n]} || $conn_hash->{$notesConn->[$n]} eq ""){
ba46c7
 				$unindexedIp = "?";
ba46c7
 			} else {
ba46c7
 				$unindexedIp = $conn_hash->{$notesConn->[$n]};
ba46c7
@@ -688,18 +691,21 @@ if ($verb eq "yes" || $usage =~ /u/){
ba46c7
 			print "  -  IP Address:            $unindexedIp\n";
ba46c7
 
ba46c7
 			for (my $nnn = 0; $nnn < $baseCount; $nnn++){
ba46c7
+				if(!$base_conn->[$nnn] || !$base_op->[$nnn]){ next; }
ba46c7
 				if ($notesConn->[$n] eq $base_conn->[$nnn] && $notesOp->[$n] eq $base_op->[$nnn]){
ba46c7
 					print "  -  Search Base:           $base_val->[$nnn]\n";
ba46c7
 					last;
ba46c7
 				}
ba46c7
 			}
ba46c7
 			for (my $nnn = 0; $nnn < $scopeCount; $nnn++){
ba46c7
+				if(!$scope_conn->[$nnn] || !$scope_op->[$nnn]){ next; }
ba46c7
 				if ($notesConn->[$n] eq $scope_conn->[$nnn] && $notesOp->[$n] eq $scope_op->[$nnn]){
ba46c7
 					print "  -  Search Scope:          $scope_val->[$nnn]\n";
ba46c7
 					last;
ba46c7
 				}
ba46c7
 			}
ba46c7
 			for (my $nnn = 0; $nnn < $filterCount; $nnn++){	
ba46c7
+				if(!$filter_conn->[$nnn] || !$filter_op->[$nnn]){ next; }
ba46c7
 				if ($notesConn->[$n] eq $filter_conn->[$nnn] && $notesOp->[$n] eq $filter_op->[$nnn]){
ba46c7
 					print "  -  Search Filter:         $filter_val->[$nnn]\n";
ba46c7
 					last;
ba46c7
@@ -727,7 +733,8 @@ if ($verb eq "yes" || $usage =~ /u/){
ba46c7
 		my $notesCount = "1";
ba46c7
 		my $unindexedIp;
ba46c7
 		for (my $n = 0; $n < scalar(@{$notesEtime}); $n++){
ba46c7
-			if($conn_hash->{$notesConn->[$n]} eq ""){
ba46c7
+			if(!$notesConn->[$n] || $notesConn->[$n] eq "" || 
ba46c7
+			   !$conn_hash->{$notesConn->[$n]} || $conn_hash->{$notesConn->[$n]} eq ""){
ba46c7
 				$unindexedIp = "?";
ba46c7
 			} else {
ba46c7
 				$unindexedIp = $conn_hash->{$notesConn->[$n]};
ba46c7
@@ -741,18 +748,21 @@ if ($verb eq "yes" || $usage =~ /u/){
ba46c7
 			print "  -  IP Address:            $unindexedIp\n";
ba46c7
 
ba46c7
 			for (my $nnn = 0; $nnn < $baseCount; $nnn++){
ba46c7
+				if(!$base_conn->[$nnn] || !$base_op->[$nnn]){ next; }
ba46c7
 				if ($notesConn->[$n] eq $base_conn->[$nnn] && $notesOp->[$n] eq $base_op->[$nnn]){
ba46c7
 					print "  -  Search Base:           $base_val->[$nnn]\n";
ba46c7
 					last;
ba46c7
 				}
ba46c7
 			}
ba46c7
 			for (my $nnn = 0; $nnn < $scopeCount; $nnn++){
ba46c7
+				if(!$scope_conn->[$nnn] || !$scope_op->[$nnn]){ next; }
ba46c7
 				if ($notesConn->[$n] eq $scope_conn->[$nnn] && $notesOp->[$n] eq $scope_op->[$nnn]){
ba46c7
 					print "  -  Search Scope:          $scope_val->[$nnn]\n";
ba46c7
 					last;
ba46c7
 				}
ba46c7
 			}
ba46c7
 			for (my $nnn = 0; $nnn < $filterCount; $nnn++){	
ba46c7
+				if(!$filter_conn->[$nnn] || !$filter_op->[$nnn]){ next; }
ba46c7
 				if ($notesConn->[$n] eq $filter_conn->[$nnn] && $notesOp->[$n] eq $filter_op->[$nnn]){
ba46c7
 					print "  -  Search Filter:         $filter_val->[$nnn]\n";
ba46c7
 					last;
ba46c7
@@ -772,13 +782,12 @@ if ($brokenPipeCount > 0){
ba46c7
 	my @etext;
ba46c7
 	foreach my $key (sort { $rc->{$b} <=> $rc->{$a} } keys %{$rc}) {
ba46c7
 		if ($rc->{$key} > 0){
ba46c7
-           if ($conn{$key} eq ""){$conn{$key} = "**Unknown**";}
ba46c7
-           push @etext, sprintf "     -  %-4s (%2s) %-40s\n",$rc->{$key},$conn{$key},$connmsg{$key
ba46c7
-};
ba46c7
-          }
ba46c7
-        }
ba46c7
-        print @etext;
ba46c7
-        print "\n";
ba46c7
+			if ($conn{$key} eq ""){$conn{$key} = "**Unknown**";}
ba46c7
+			push @etext, sprintf "     -  %-4s (%2s) %-40s\n",$rc->{$key},$conn{$key},$connmsg{$key};
ba46c7
+		}
ba46c7
+	}
ba46c7
+	print @etext;
ba46c7
+	print "\n";
ba46c7
 }
ba46c7
 
ba46c7
 print "Connections Reset By Peer:    $connResetByPeerCount\n";
ba46c7
@@ -787,12 +796,11 @@ if ($connResetByPeerCount > 0){
ba46c7
 	my @retext;
ba46c7
 	foreach my $key (sort { $src->{$b} <=> $src->{$a} } keys %{$src}) {
ba46c7
 		if ($src->{$key} > 0){
ba46c7
-           if ($conn{$key} eq ""){$conn{$key} = "**Unknown**";}
ba46c7
-           push @retext, sprintf "     -  %-4s (%2s) %-40s\n",$src->{$key},$conn{$key},$connmsg{$key
ba46c7
-};
ba46c7
-          }
ba46c7
-        }
ba46c7
-        print @retext;
ba46c7
+			if ($conn{$key} eq ""){$conn{$key} = "**Unknown**";}
ba46c7
+			push @retext, sprintf "     -  %-4s (%2s) %-40s\n",$src->{$key},$conn{$key},$connmsg{$key};
ba46c7
+		}
ba46c7
+	}
ba46c7
+ 	print @retext;
ba46c7
 	print "\n";
ba46c7
 }
ba46c7
 
ba46c7
@@ -802,9 +810,9 @@ if ($resourceUnavailCount > 0){
ba46c7
 	my @rtext;
ba46c7
 	foreach my $key (sort { $rsrc->{$b} <=> $rsrc->{$a} } keys %{$rsrc}) {
ba46c7
 		if ($rsrc->{$key} > 0){
ba46c7
-           if ($conn{$key} eq ""){$conn{$key} = "**Resource Issue**";}
ba46c7
-           push @rtext, sprintf "     -  %-4s (%2s) %-40s\n",$rsrc->{$key},$conn{$key},$connmsg{$key};
ba46c7
-          }
ba46c7
+			if ($conn{$key} eq ""){$conn{$key} = "**Resource Issue**";}
ba46c7
+			push @rtext, sprintf "     -  %-4s (%2s) %-40s\n",$rsrc->{$key},$conn{$key},$connmsg{$key};
ba46c7
+		}
ba46c7
   	}
ba46c7
   	print @rtext;
ba46c7
 }
ba46c7
@@ -1244,48 +1252,57 @@ if ($usage =~ /g/i || $verb eq "yes"){
ba46c7
 			my $op = $arrays->{targetop}->[$g];
ba46c7
 			my $msgid = $arrays->{msgid}->[$g];
ba46c7
 			for (my $sc = 0; $sc < $srchCount; $sc++){
ba46c7
-				if ($arrays->{srchconn}->[$sc] eq $conn && $arrays->{srchop}->[$sc] eq $op ){
ba46c7
+				if (($arrays->{srchconn}->[$sc] && $arrays->{srchop}->[$sc]) && 
ba46c7
+				    ($arrays->{srchconn}->[$sc] eq $conn && $arrays->{srchop}->[$sc] eq $op )){
ba46c7
 					print " - SRCH conn=$conn op=$op msgid=$msgid client=$conn_hash->{$conn}\n";	
ba46c7
 				}
ba46c7
 			}
ba46c7
 			for (my $dc = 0; $dc < $delCount; $dc++){
ba46c7
-				if ($arrays->{delconn}->[$dc] eq $conn && $arrays->{delop}->[$dc] eq $op){
ba46c7
-					print " - DEL conn=$conn op=$op msgid=$msgid client=$conn_hash->{$conn}\n";
ba46c7
+				if (($arrays->{delconn}->[$dc] && $arrays->{delop}->[$dc]) &&
ba46c7
+				    ($arrays->{delconn}->[$dc] eq $conn && $arrays->{delop}->[$dc] eq $op)){
ba46c7
+					print " - DEL  conn=$conn op=$op msgid=$msgid client=$conn_hash->{$conn}\n";
ba46c7
 				}
ba46c7
 			}
ba46c7
 			for (my $adc = 0; $adc < $addCount; $adc++){
ba46c7
-				if ($arrays->{addconn}->[$adc] eq $conn && $arrays->{addop}->[$adc] eq $op){
ba46c7
-					print " - ADD conn=$conn op=$op msgid=$msgid client=$conn_hash->{$conn}\n";
ba46c7
+				if (($arrays->{addconn}->[$adc] && $arrays->{addop}->[$adc]) &&
ba46c7
+				    ($arrays->{addconn}->[$adc] eq $conn && $arrays->{addop}->[$adc] eq $op)){
ba46c7
+					print " - ADD  conn=$conn op=$op msgid=$msgid client=$conn_hash->{$conn}\n";
ba46c7
 				}
ba46c7
 			}
ba46c7
 			for (my $mc = 0; $mc < $modCount; $mc++){
ba46c7
-				if ($arrays->{modconn}->[$mc] eq $conn && $arrays->{modop}->[$mc] eq $op){
ba46c7
-					print " - MOD conn=$conn op=$op msgid=$msgid client=$conn_hash->{$conn}\n";
ba46c7
+				if (($arrays->{modconn}->[$mc] && $arrays->{modop}->[$mc]) &&
ba46c7
+				    ($arrays->{modconn}->[$mc] eq $conn && $arrays->{modop}->[$mc] eq $op)){
ba46c7
+					print " - MOD  conn=$conn op=$op msgid=$msgid client=$conn_hash->{$conn}\n";
ba46c7
 				}
ba46c7
 			}
ba46c7
 			for (my $cc = 0; $cc < $cmpCount; $cc++){
ba46c7
-				if ($arrays->{cmpconn}->[$cc] eq $conn && $arrays->{cmpop}->[$cc] eq $op){
ba46c7
-					print " - CMP conn=$conn op=$op msgid=$msgid client=$conn_hash->{$conn}\n";
ba46c7
+				if (($arrays->{cmpconn}->[$cc] && $arrays->{cmpop}->[$cc]) &&
ba46c7
+				    ($arrays->{cmpconn}->[$cc] eq $conn && $arrays->{cmpop}->[$cc] eq $op)){
ba46c7
+					print " - CMP  conn=$conn op=$op msgid=$msgid client=$conn_hash->{$conn}\n";
ba46c7
 				}
ba46c7
 			}
ba46c7
 			for (my $mdc = 0; $mdc < $modrdnCount; $mdc++){
ba46c7
-				if ($arrays->{modrdnconn}->[$mdc] eq $conn && $arrays->{modrdnop}->[$mdc] eq $op){
ba46c7
+				if (($arrays->{modrdnconn}->[$mdc] && $arrays->{modrdnop}->[$mdc]) &&
ba46c7
+				    ($arrays->{modrdnconn}->[$mdc] eq $conn && $arrays->{modrdnop}->[$mdc] eq $op)){
ba46c7
 					print " - MODRDN conn=$conn op=$op msgid=$msgid client=$conn_hash->{$conn}\n";
ba46c7
 				}
ba46c7
 			}
ba46c7
 			for (my $bcb = 0; $bcb < $bindCount; $bcb++){
ba46c7
-				if ($arrays->{bindconn}->[$bcb] eq $conn && $arrays->{bindop}->[$bcb] eq $op){
ba46c7
+				if (($arrays->{bindconn}->[$bcb] && $arrays->{bindop}->[$bcb]) &&
ba46c7
+				    ($arrays->{bindconn}->[$bcb] eq $conn && $arrays->{bindop}->[$bcb] eq $op)){
ba46c7
 					print " - BIND conn=$conn op=$op msgid=$msgid client=$conn_hash->{$conn}\n";
ba46c7
 				}
ba46c7
 			}
ba46c7
 			for (my $ubc = 0; $ubc < $unbindCount; $ubc++){
ba46c7
-				if ($arrays->{unbindconn}->[$ubc] eq $conn && $arrays->{unbindop}->[$ubc] eq $op){
ba46c7
+				if (($arrays->{unbindconn}->[$ubc] && $arrays->{unbindop}->[$ubc]) &&
ba46c7
+				    ($arrays->{unbindconn}->[$ubc] eq $conn && $arrays->{unbindop}->[$ubc] eq $op)){
ba46c7
 					print " - UNBIND conn=$conn op=$op msgid=$msgid client=$conn_hash->{$conn}\n";
ba46c7
 				}
ba46c7
 			}
ba46c7
 			for (my $ec = 0; $ec < $extopCount; $ec++){
ba46c7
-				if ($arrays->{extconn}->[$ec] eq $conn && $arrays->{extop}->[$ec] eq $op){
ba46c7
-					print " - EXT conn=$conn op=$op msgid=$msgid client=$conn_hash->{$conn}\n";
ba46c7
+				if (($arrays->{extconn}->[$ec] && $arrays->{extop}->[$ec]) &&
ba46c7
+				    ($arrays->{extconn}->[$ec] eq $conn && $arrays->{extop}->[$ec] eq $op)){
ba46c7
+					print " - EXT  conn=$conn op=$op msgid=$msgid client=$conn_hash->{$conn}\n";
ba46c7
 				}
ba46c7
 			}
ba46c7
 		}
ba46c7
@@ -1485,7 +1502,7 @@ parseLineBind {
ba46c7
 			return ;
ba46c7
 		}
ba46c7
 		$ip = $1;
ba46c7
-		if ($_ =~ /conn= *([0-9]+)/i ){
ba46c7
+		if ($_ =~ /conn= *([0-9A-Z]+)/i ){
ba46c7
 			$connList{$ip} = $connList{$ip} . " $1 ";
ba46c7
 		}
ba46c7
 		return;
ba46c7
@@ -1516,7 +1533,7 @@ parseLineBind {
ba46c7
 			$bindReport{$dn}{"modrdn"} = 0;
ba46c7
 			$bindReport{$dn}{"failedBind"} = 0;
ba46c7
 		}
ba46c7
-		if ($_ =~ /conn= *([0-9]+)/i) {
ba46c7
+		if ($_ =~ /conn= *([0-9A-Z]+)/i) {
ba46c7
 			$bindReport{$dn}{"conn"} = $bindReport{$dn}{"conn"} . " $1 ";
ba46c7
 		}
ba46c7
 		return;
ba46c7
@@ -1547,7 +1564,7 @@ processOpForBindReport
ba46c7
 	my $op = shift;
ba46c7
 	my $data = shift;
ba46c7
 
ba46c7
-	if ($data =~ /conn= *([0-9]+)/i) {
ba46c7
+	if ($data =~ /conn= *([0-9A-Z]+)/i) {
ba46c7
 		foreach my $dn (keys %bindReport){
ba46c7
 			if ($bindReport{$dn}{"conn"} =~ / $1 /){
ba46c7
 				$bindReport{$dn}{$op}++;
ba46c7
@@ -1649,48 +1666,48 @@ sub parseLineNormal
ba46c7
 			$anyAttrs++;
ba46c7
 		}
ba46c7
 		if ($verb eq "yes"){
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i){ push @{$arrays->{srchconn}}, $1;}
ba46c7
-			if ($_ =~ /op= *([0-9]+)/i){ push @{$arrays->{srchop}}, $1;}
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i){ push @{$arrays->{srchconn}}, $1;}
ba46c7
+			if ($_ =~ /op= *([0-9\-]+)/i){ push @{$arrays->{srchop}}, $1;}
ba46c7
 		}
ba46c7
 	}
ba46c7
 	if (m/ DEL/){
ba46c7
 		$delCount++;
ba46c7
 		if($reportStats){ inc_stats('del',$s_stats,$m_stats); }
ba46c7
 		if ($verb eq "yes"){
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i){ push @{$arrays->{delconn}}, $1;}
ba46c7
-			if ($_ =~ /op= *([0-9]+)/i){ push @{$arrays->{delop}}, $1;}
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i){ push @{$arrays->{delconn}}, $1;}
ba46c7
+			if ($_ =~ /op= *([0-9\-]+)/i){ push @{$arrays->{delop}}, $1;}
ba46c7
 		}
ba46c7
 	}
ba46c7
 	if (m/ MOD dn=/){
ba46c7
 		$modCount++;
ba46c7
 		if($reportStats){ inc_stats('mod',$s_stats,$m_stats); }
ba46c7
 		if ($verb eq "yes"){
ba46c7
-		        if ($_ =~ /conn= *([0-9]+)/i){ push @{$arrays->{modconn}}, $1;}
ba46c7
-			if ($_ =~ /op= *([0-9]+)/i){ push @{$arrays->{modop}}, $1; }
ba46c7
+		        if ($_ =~ /conn= *([0-9A-Z]+)/i){ push @{$arrays->{modconn}}, $1;}
ba46c7
+			if ($_ =~ /op= *([0-9\-]+)/i){ push @{$arrays->{modop}}, $1; }
ba46c7
 		}
ba46c7
 	}
ba46c7
 	if (m/ ADD/){
ba46c7
 		$addCount++;
ba46c7
 		if($reportStats){ inc_stats('add',$s_stats,$m_stats); }
ba46c7
 		if ($verb eq "yes"){
ba46c7
-		        if ($_ =~ /conn= *([0-9]+)/i){ push @{$arrays->{addconn}}, $1; }
ba46c7
-			if ($_ =~ /op= *([0-9]+)/i){ push @{$arrays->{addop}}, $1; }
ba46c7
+		        if ($_ =~ /conn= *([0-9A-Z]+)/i){ push @{$arrays->{addconn}}, $1; }
ba46c7
+			if ($_ =~ /op= *([0-9\-]+)/i){ push @{$arrays->{addop}}, $1; }
ba46c7
 		}
ba46c7
 	}
ba46c7
 	if (m/ MODRDN/){
ba46c7
 		$modrdnCount++;
ba46c7
 		if($reportStats){ inc_stats('modrdn',$s_stats,$m_stats); }
ba46c7
 		if ($verb eq "yes"){
ba46c7
-		        if ($_ =~ /conn= *([0-9]+)/i){ push @{$arrays->{modrdnconn}}, $1; }
ba46c7
-			if ($_ =~ /op= *([0-9]+)/i){ push @{$arrays->{modrdnop}}, $1; }
ba46c7
+		        if ($_ =~ /conn= *([0-9A-Z]+)/i){ push @{$arrays->{modrdnconn}}, $1; }
ba46c7
+			if ($_ =~ /op= *([0-9\-]+)/i){ push @{$arrays->{modrdnop}}, $1; }
ba46c7
 		}
ba46c7
 	}
ba46c7
 	if (m/ CMP dn=/){
ba46c7
 		$cmpCount++;
ba46c7
 		if($reportStats){ inc_stats('cmp',$s_stats,$m_stats); }
ba46c7
 		if ($verb eq "yes"  || $usage =~ /g/i){
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i){ push @{$arrays->{cmpconn}}, $1;}
ba46c7
-			if ($_ =~ /op= *([0-9]+)/i){ push @{$arrays->{cmpop}}, $1;}
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i){ push @{$arrays->{cmpconn}}, $1;}
ba46c7
+			if ($_ =~ /op= *([0-9\-]+)/i){ push @{$arrays->{cmpop}}, $1;}
ba46c7
 		}
ba46c7
 	}
ba46c7
 	if (m/ ABANDON /){
ba46c7
@@ -1699,13 +1716,13 @@ sub parseLineNormal
ba46c7
 		$allResults++;
ba46c7
 		if ($_ =~ /targetop= *([0-9a-zA-Z]+)/i ){
ba46c7
 			push @{$arrays->{targetop}}, $1;
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i){ push @{$arrays->{targetconn}}, $1; }
ba46c7
-			if ($_ =~ /msgid= *([0-9]+)/i){ push @{$arrays->{msgid}}, $1; }
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i){ push @{$arrays->{targetconn}}, $1; }
ba46c7
+			if ($_ =~ /msgid= *([0-9\-]+)/i){ push @{$arrays->{msgid}}, $1; }
ba46c7
 		}
ba46c7
 	}
ba46c7
 	if (m/ VLV /){
ba46c7
-		if ($_ =~ /conn= *([0-9]+)/i){ $vlvconn[$vlvCount] = $1;}
ba46c7
-		if ($_ =~ /op= *([0-9]+)/i){  $vlvop[$vlvCount] = $1;}
ba46c7
+		if ($_ =~ /conn= *([0-9A-Z]+)/i){ $vlvconn[$vlvCount] = $1;}
ba46c7
+		if ($_ =~ /op= *([0-9\-]+)/i){  $vlvop[$vlvCount] = $1;}
ba46c7
 		$vlvCount++;
ba46c7
 	}
ba46c7
 	if (m/ authzid=/){
ba46c7
@@ -1792,16 +1809,16 @@ sub parseLineNormal
ba46c7
 			$tmpp = $1;
ba46c7
 			$tmpp =~ tr/A-Z/a-z/;
ba46c7
 			$hashes->{bindlist}->{$tmpp}++;
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i) { push @{$arrays->{bindconn}}, $1;}
ba46c7
-			if ($_ =~ /op= *([0-9]+)/i) { push @{$arrays->{bindop}}, $1;}
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i) { push @{$arrays->{bindconn}}, $1;}
ba46c7
+			if ($_ =~ /op= *([0-9\-]+)/i) { push @{$arrays->{bindop}}, $1;}
ba46c7
 			if($usage =~ /f/ || $verb eq "yes"){
ba46c7
 				push @{$arrays->{binddn}}, $tmpp;
ba46c7
 			}
ba46c7
 		} else {
ba46c7
 			$anonymousBindCount++;
ba46c7
 			$hashes->{bindlist}->{"Anonymous Binds"}++;
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i) { push @{$arrays->{bindconn}}, $1;}
ba46c7
-			if ($_ =~ /op= *([0-9]+)/i) { push @{$arrays->{bindop}}, $1;}
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i) { push @{$arrays->{bindconn}}, $1;}
ba46c7
+			if ($_ =~ /op= *([0-9\-]+)/i) { push @{$arrays->{bindop}}, $1;}
ba46c7
 			push @{$arrays->{binddn}}, "";
ba46c7
 			inc_stats('anonbind',$s_stats,$m_stats);
ba46c7
 		}
ba46c7
@@ -1809,17 +1826,18 @@ sub parseLineNormal
ba46c7
 	if (m/ UNBIND/){
ba46c7
 		$unbindCount++;
ba46c7
 		if ($verb eq "yes"){
ba46c7
-		        if ($_ =~ /conn= *([0-9]+)/i){ push @{$arrays->{unbindconn}}, $1; }
ba46c7
-			if ($_ =~ /op= *([0-9]+)/i){ push @{$arrays->{unbindop}}, $1; }
ba46c7
+		        if ($_ =~ /conn= *([0-9A-Z]+)/i){ push @{$arrays->{unbindconn}}, $1; }
ba46c7
+			if ($_ =~ /op= *([0-9\-]+)/i){ push @{$arrays->{unbindop}}, $1; }
ba46c7
 		}
ba46c7
 	}
ba46c7
 	if (m/ RESULT err=/ && m/ notes=P/){
ba46c7
 		$pagedSearchCount++;
ba46c7
 	}
ba46c7
 	if (m/ notes=A/){
ba46c7
-		if ($_ =~ /conn= *([0-9]+)/i){
ba46c7
+		$con = "";
ba46c7
+		if ($_ =~ /conn= *([0-9A-Z]+)/i){
ba46c7
 		        $con = $1;
ba46c7
-		        if ($_ =~ /op= *([0-9]+)/i){ $op = $1;}
ba46c7
+		        if ($_ =~ /op= *([0-9\-]+)/i){ $op = $1;}
ba46c7
 		}
ba46c7
 		for (my $i=0; $i < $vlvCount;$i++){
ba46c7
 		        if ($vlvconn[$i] eq $con && $vlvop[$i] eq $op){ $vlvNotesACount++; $isVlvNotes="1";}
ba46c7
@@ -1833,8 +1851,8 @@ sub parseLineNormal
ba46c7
 		if ($usage =~ /u/ || $verb eq "yes"){
ba46c7
 			if ($isVlvNotes == 0 ){
ba46c7
 		        	if ($_ =~ /etime= *([0-9.]+)/i ){ push @{$arrays->{notesAetime}}, $1; }
ba46c7
-		        	if ($_ =~ /conn= *([0-9]+)/i){ push @{$arrays->{notesAconn}}, $1; }
ba46c7
-		        	if ($_ =~ /op= *([0-9]+)/i){ push @{$arrays->{notesAop}}, $1; }
ba46c7
+		        	if ($_ =~ /conn= *([0-9A-Z]+)/i){ push @{$arrays->{notesAconn}}, $1; }
ba46c7
+		        	if ($_ =~ /op= *([0-9\-]+)/i){ push @{$arrays->{notesAop}}, $1; }
ba46c7
 		        	if ($_ =~ / *([0-9a-z:\/]+)/i){ push @{$arrays->{notesAtime}}, $1; }
ba46c7
 				if ($_ =~ /nentries= *([0-9]+)/i ){ push @{$arrays->{notesAnentries}}, $1; }
ba46c7
 			}
ba46c7
@@ -1842,9 +1860,10 @@ sub parseLineNormal
ba46c7
 		$isVlvNotes = 0;
ba46c7
 	}
ba46c7
 	if (m/ notes=U/){
ba46c7
-		if ($_ =~ /conn= *([0-9]+)/i){
ba46c7
+		$con = "";
ba46c7
+		if ($_ =~ /conn= *([0-9A-Z]+)/i){
ba46c7
 		        $con = $1;
ba46c7
-		        if ($_ =~ /op= *([0-9]+)/i){ $op = $1;}
ba46c7
+		        if ($_ =~ /op= *([0-9\-]+)/i){ $op = $1;}
ba46c7
 		}
ba46c7
 		for (my $i=0; $i < $vlvCount;$i++){
ba46c7
 		        if ($vlvconn[$i] eq $con && $vlvop[$i] eq $op){ $vlvNotesUCount++; $isVlvNotes="1";}
ba46c7
@@ -1858,8 +1877,8 @@ sub parseLineNormal
ba46c7
 		if ($usage =~ /u/ || $verb eq "yes"){
ba46c7
 			if ($isVlvNotes == 0 ){
ba46c7
 		        	if ($_ =~ /etime= *([0-9.]+)/i ){ push @{$arrays->{notesUetime}}, $1; }
ba46c7
-		        	if ($_ =~ /conn= *([0-9]+)/i){ push @{$arrays->{notesUconn}}, $1; }
ba46c7
-		        	if ($_ =~ /op= *([0-9]+)/i){ push @{$arrays->{notesUop}}, $1; }
ba46c7
+		        	if ($_ =~ /conn= *([0-9A-Z]+)/i){ push @{$arrays->{notesUconn}}, $1; }
ba46c7
+		        	if ($_ =~ /op= *([0-9\-]+)/i){ push @{$arrays->{notesUop}}, $1; }
ba46c7
 		        	if ($_ =~ / *([0-9a-z:\/]+)/i){ push @{$arrays->{notesUtime}}, $1; }
ba46c7
 				if ($_ =~ /nentries= *([0-9]+)/i ){ push @{$arrays->{notesUnentries}}, $1; }
ba46c7
 			}
ba46c7
@@ -1922,14 +1941,14 @@ sub parseLineNormal
ba46c7
 			}
ba46c7
 			$ip = $1;
ba46c7
 			$hashes->{ip_hash}->{$ip}++;
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i ){ 
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i ){ 
ba46c7
 				if ($exc ne "yes"){	
ba46c7
 					$hashes->{conn_hash}->{$1} = $ip;
ba46c7
 				}
ba46c7
 			}
ba46c7
 		}
ba46c7
 		if (m/- A1/){
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i) {
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i) {
ba46c7
 				$exc = "no";
ba46c7
 				$ip = getIPfromConn($1);
ba46c7
 				if ($ip eq ""){$ip = "Unknown_Host";}
ba46c7
@@ -1944,7 +1963,7 @@ sub parseLineNormal
ba46c7
 			}
ba46c7
 		}
ba46c7
 		if (m/- B1/){
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i) {
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i) {
ba46c7
 				$exc = "no";
ba46c7
 				$ip = getIPfromConn($1);
ba46c7
 				if ($ip eq ""){$ip = "Unknown_Host";}
ba46c7
@@ -1959,7 +1978,7 @@ sub parseLineNormal
ba46c7
 			}
ba46c7
 		}
ba46c7
 		if (m/- B4/){
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i) {
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i) {
ba46c7
 				$exc = "no";
ba46c7
 				$ip = getIPfromConn($1);
ba46c7
 				if ($ip eq ""){$ip = "Unknown_Host";}
ba46c7
@@ -1974,7 +1993,7 @@ sub parseLineNormal
ba46c7
 		    	}
ba46c7
 		}
ba46c7
 		if (m/- T1/){
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i) {
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i) {
ba46c7
 				$exc = "no";
ba46c7
 			       	$ip = getIPfromConn($1);
ba46c7
 				if ($ip eq ""){$ip = "Unknown_Host";}
ba46c7
@@ -1989,7 +2008,7 @@ sub parseLineNormal
ba46c7
 			}
ba46c7
 		}
ba46c7
 		if (m/- T2/){
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i) {
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i) {
ba46c7
 				$exc = "no"; 
ba46c7
 				$ip = getIPfromConn($1);
ba46c7
 				if ($ip eq ""){$ip = "Unknown_Host";}
ba46c7
@@ -2004,7 +2023,7 @@ sub parseLineNormal
ba46c7
 			}
ba46c7
 		}
ba46c7
 		if (m/- B2/){
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i) {
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i) {
ba46c7
 				$exc = "no";
ba46c7
 				$ip = getIPfromConn($1);
ba46c7
 				$maxBerSizeCount++;
ba46c7
@@ -2020,7 +2039,7 @@ sub parseLineNormal
ba46c7
 			}
ba46c7
 		}
ba46c7
 		if (m/- B3/){
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i) {
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i) {
ba46c7
 				$exc = "no";
ba46c7
 				$ip = getIPfromConn($1);
ba46c7
 				if ($ip eq ""){$ip = "Unknown_Host";}
ba46c7
@@ -2035,7 +2054,7 @@ sub parseLineNormal
ba46c7
 			}
ba46c7
 		}
ba46c7
 		if (m/- R1/){
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i) {
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i) {
ba46c7
 				$exc = "no";
ba46c7
 				$ip = getIPfromConn($1);
ba46c7
 				if ($ip eq ""){$ip = "Unknown_Host";}
ba46c7
@@ -2050,7 +2069,7 @@ sub parseLineNormal
ba46c7
 			}
ba46c7
 		}
ba46c7
 		if (m/- P1/){
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i) {
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i) {
ba46c7
 				$exc = "no";
ba46c7
 				$ip = getIPfromConn($1);
ba46c7
 				if ($ip eq ""){$ip = "Unknown_Host";}
ba46c7
@@ -2065,7 +2084,7 @@ sub parseLineNormal
ba46c7
 			}
ba46c7
 		}
ba46c7
 		if (m/- P2/){
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i) {
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i) {
ba46c7
 				$exc = "no";
ba46c7
 				$ip = getIPfromConn($1);
ba46c7
 				if ($ip eq ""){$ip = "Unknown_Host";}
ba46c7
@@ -2080,7 +2099,7 @@ sub parseLineNormal
ba46c7
 			}
ba46c7
 		}
ba46c7
 		if (m/- U1/){
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i) {
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i) {
ba46c7
 				$exc = "no";
ba46c7
 				$ip = getIPfromConn($1);
ba46c7
 				if ($ip eq ""){$ip = "Unknown_Host";}
ba46c7
@@ -2112,8 +2131,8 @@ sub parseLineNormal
ba46c7
 		if ($_ =~ /oid=\" *([0-9\.]+)/i ){ $hashes->{oid}->{$1}++; }
ba46c7
 		if ($1 && $1 eq $startTLSoid){$startTLSCount++;}
ba46c7
 		if ($verb eq "yes"){
ba46c7
-		        if ($_ =~ /conn= *([0-9]+)/i){ push @{$arrays->{extconn}}, $1; }
ba46c7
-			if ($_ =~ /op= *([0-9]+)/i){ push @{$arrays->{extop}}, $1; }
ba46c7
+		        if ($_ =~ /conn= *([0-9A-Z]+)/i){ push @{$arrays->{extconn}}, $1; }
ba46c7
+			if ($_ =~ /op= *([0-9\-]+)/i){ push @{$arrays->{extop}}, $1; }
ba46c7
 		}
ba46c7
 	}
ba46c7
 	if (($usage =~ /l/ || $verb eq "yes") and / SRCH /){
ba46c7
@@ -2123,15 +2142,15 @@ sub parseLineNormal
ba46c7
 			$tmpp =~ tr/A-Z/a-z/;
ba46c7
 			$tmpp =~ s/\\22/\"/g;
ba46c7
 			$hashes->{filter}->{$tmpp}++;
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i) { $filterConn = $1; }
ba46c7
-			if ($_ =~ /op= *([0-9]+)/i) { $filterOp = $1; }
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i) { $filterConn = $1; }
ba46c7
+			if ($_ =~ /op= *([0-9\-]+)/i) { $filterOp = $1; }
ba46c7
 		} elsif (/ SRCH / && $_ =~ /filter=\"(.*)\"/i){
ba46c7
 			$tmpp = $1;
ba46c7
 			$tmpp =~ tr/A-Z/a-z/;
ba46c7
 			$tmpp =~ s/\\22/\"/g;
ba46c7
 			$hashes->{filter}->{$tmpp}++;
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i) { $filterConn = $1; }
ba46c7
-			if ($_ =~ /op= *([0-9]+)/i) { $filterOp = $1; }
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i) { $filterConn = $1; }
ba46c7
+			if ($_ =~ /op= *([0-9\-]+)/i) { $filterOp = $1; }
ba46c7
 		}
ba46c7
 		$filterCount++;
ba46c7
 		if($usage =~ /u/ || $verb eq "yes"){
ba46c7
@@ -2157,11 +2176,11 @@ sub parseLineNormal
ba46c7
 			if ($_ =~ /scope= *([0-9]+)/i) { 
ba46c7
 				$scopeVal = $1; 
ba46c7
 			}
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i) { 
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i) { 
ba46c7
 				$baseConn = $1; 
ba46c7
 				$scopeConn = $1;	
ba46c7
 			}
ba46c7
-			if ($_ =~ /op= *([0-9]+)/i) { 
ba46c7
+			if ($_ =~ /op= *([0-9\-]+)/i) { 
ba46c7
 				$baseOp = $1;
ba46c7
 				$scopeOp = $1;
ba46c7
 			}
ba46c7
@@ -2170,9 +2189,9 @@ sub parseLineNormal
ba46c7
 				push @{$arrays->{baseval}}, $tmpp;
ba46c7
 				push @{$arrays->{baseconn}}, $baseConn;
ba46c7
 				push @{$arrays->{baseop}}, $baseOp;
ba46c7
-				push @{$arrays->{scopeval}}, $scopeVal;
ba46c7
-				push @{$arrays->{scopeconn}}, $scopeConn;
ba46c7
-				push @{$arrays->{scopeop}}, $scopeOp;
ba46c7
+				push @{$arrays->{scopeval}}, $scopeTxt[$scopeVal]; 
ba46c7
+				push @{$arrays->{scopeconn}}, $scopeConn; 
ba46c7
+				push @{$arrays->{scopeop}}, $scopeOp; 
ba46c7
 			}
ba46c7
 			$baseCount++;
ba46c7
 			$scopeCount++;
ba46c7
@@ -2191,12 +2210,12 @@ sub parseLineNormal
ba46c7
 			$ds6x = "true";
ba46c7
 			$badPwdCount++;
ba46c7
 		} elsif (/ err=49 tag=/ ){
ba46c7
-			if ($_ =~ /conn= *([0-9]+)/i ){
ba46c7
+			if ($_ =~ /conn= *([0-9A-Z]+)/i ){
ba46c7
 				push @{$arrays->{badpwdconn}}, $1;
ba46c7
 				$ip = getIPfromConn($1);
ba46c7
 				$badPwdCount++;
ba46c7
 			}
ba46c7
-			if ($_ =~ /op= *([0-9]+)/i ){
ba46c7
+			if ($_ =~ /op= *([0-9\-]+)/i ){
ba46c7
 				push @{$arrays->{badpwdop}}, $1;
ba46c7
 			}
ba46c7
 			push @{$arrays->{badpwdip}}, $ip;
ba46c7
-- 
ba46c7
1.7.1
ba46c7