[Tue May 22 14:47:44 IST 2007][192.168.1.91][sunny][Distribution] Error: ct_connect(): directory service layer: internal directory control layer error: Requested server name not found.
[Tue May 22 14:47:44 IST 2007][192.168.1.81][sridhar][PAD Manager] Warning: Failback not supported.
[Tue May 22 14:47:44 IST 2007][192.168.1.93][sentini][Remote Editing] Error: Results processing failed.
####
#! /usr/bin/perl
my $sel_user,$sel_host,$sel_mod;
print "\nEnter your choice for user: ";
$sel_user=;
chomp($sel_user);
print "\nEnter your choice for host: ";
$sel_host=;
chomp($sel_host);
print "\nEnter your choice for module: ";
$sel_mod=;
chomp($sel_mod);
my $dir = './logs/commonlogs';
opendir my $dh, $dir or die "Can't opendir '$dir': $!\n";
my @files = grep { ! -d "$dir/$_" and ! /user.log/ } readdir $dh;
foreach my $fname ( @files )
{
#chomp($fname);
$filename="$dir/$fname";
open(FH, $filename) or die "Error : $! \n" ;
while($audit_data=) ### For greping out required data ##############################
{
@check=split(']\[|]\s+|^\[',$audit_data);
#print " $_ :: \n \n audit data $audit_data \n \n" foreach(@check);
if($check[3] =~ /^$sel_user$/ && $check[2] =~ /^$sel_host$/ && $check[4] =~ /^$sel_mod$/)
{
print " In first -- >> $audit_data";
}
elsif($check[3] =~ /$sel_user/ && $check[2] =~ /$sel_host/ && $sel_mod =~ /All/i)
{
print "In Second --- >> $audit_data";
}
elsif($check[2] =~ /$sel_host/ && $check[4] =~ /$sel_mod/ && $sel_user=~ /All/i)
{
print "In Third -- >$audit_data";
}
elsif($check[3] =~ /$sel_user/ && $check[4] =~ /$sel_mod/ && $sel_host=~ /All/i)
{
print "In Forth --> $audit_data";
}
elsif($sel_user =~ /All/i && $sel_mod =~ /All/i && $check[2] =~ /$sel_host/)
{
print " In fifth -> $audit_data";
}
elsif($sel_user =~ /All/i && $check[4] =~ /$sel_mod/ && $sel_host =~ /All/i)
{
print " In sixth -> $audit_data";
}
elsif($check[3] =~ /$sel_user/i && $sel_mod =~ /All/i && $sel_host =~ /All/i)
{
print " In seventh -> $audit_data";
}
elsif($sel_user =~ /All/i && $sel_mod =~ /All/i && $sel_host =~ /All/i)
{
print " In last -> $audit_data";
}
}
}