in reply to Re^2: Pull users with multiple search
in thread Pull users with multiple search
So you are really looking for a programmer to do the job for you ... ;(
Anyways: your requirement "last hour" can be ignored, as your log file only covers the last hour. So it is only
use strict; use warnings; my %user; my %conn; while(<DATA>){ my ($conn) = /conn=(\d+)\s/; my ($uid) = /uid=(.*?),/; $uid ? $user{$conn}=$uid : $conn{$conn}++; } for my $key ( keys %conn ) { print $user{$key}//"Unknown user"; print ": $conn{$key} times in logfile\n"; } __DATA__ [04/Jun/2013:13:06:13 -0600] conn=13570 op=14 msgId=13 - BIND dn="uid= +xyz123,ou=People,o=xyz.com" method=128 version=3 [04/Jun/2013:15:06:13 -0600] conn=13570 op=14 msgId=15 - RESULT err=0 +tag=101 nentries=48030 etime=139 SRCH=Q [04/Jun/2013:15:06:13 -0600] conn=13570 op=14 msgId=15 - RESULT err=0 +tag=101 nentries=48030 etime=139 SRCH=Q [04/Jun/2013:15:06:13 -0600] conn=13571 op=14 msgId=15 - RESULT err=0 +tag=101 nentries=48030 etime=139 SRCH=Q
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Pull users with multiple search
by johnprince1980 (Initiate) on Jun 10, 2013 at 05:42 UTC | |
by johnprince1980 (Initiate) on Jun 10, 2013 at 19:42 UTC |