Dear Walter
Put all this records in a file c:\test.log.and use this code. It will show
Ip Address as well as PORT Number.
--
open(READ,"c:\\test.log");
while(){
if(/(\d{1,3}\.\d{1,3}\.\d{1,3
At 04:53 PM 9/21/2001 +0200, walter valenti wrote:
>How i can write a reg. expr for find the IP address in log file like:
>
>15:46:25.967683 194.244.46.38.1412 > 207.88.221.53.119: . ack 1115 win
>8760 (DF)
>15:46:26.600505 194.244.46.38.1412 > 207.88.221.53.119: P 15:21(6) ack
>1115 win 8760 (DF)
Here is one way:
(/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/g)
-Original Message-
From: walter valenti [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 21, 2001 10:53 AM
To: [EMAIL PROTECTED]
Subject: reg expr
How i can write a reg. expr for find the IP address in log file like:
15:46:25
I am assuming you want all and in this case I am just printing them. You could
push on to an array or create a hash:
#!perl -w
my $in = 0;
while ( ) {
chomp;
$in++;
while ( /\s((\d{1,3}\.){3}\d{1,3})/g ) {
printf "ln: %5d $1\n", $in;
}
print "\n";
}
__DATA__
15: