Hi,
A log file contains several of these lines:
session. blablahbla
blablabla proto:6 blablabla srcip:90.0.0.1 blablabla
blablabla srcport:3243 blablabla dstport:23 blablabla
session. blablahbla
blablabla proto:6 blablabla srcip:90.0.0.1 blablabla
blablabla srcport:3243 blablabla dstport:23 blablabla
session. blablahbla
blablabla proto:6 blablabla srcip:90.0.0.1 blablabla
blablabla srcport:3243 blablabla dstport:23 blablabla
basically, for each session, I need to obtain:
srcip, srcport, dstip, dstport, then do something with
it, say put it in a table;
So far here's what I got: :-)
my $sessionlog = shift @ARGV;
my $sessioncounter = '0';
my $start;
my $srcip;
my $srcport;
my $dstip;
my $dstport;
open SESSIONLOGS, "$sessionlog" or die $!;
while (<SESSIONLOGS>){
if (/^session/){
$start = "true";
++$sessioncounter;
}
}
#the logic I am thinking of here is to:
#for every line, if it sees the word session and until
it sees a new one, then mark it as a beggining of a
session with $start. process the following lines, only
until it sees another "session" keyword. then store
all the corresponding regex it see into:
my $srcip;
my $srcport;
my $dstip;
my $dstport;
the problem is... I'm not sure how to do it. :-)
can you help we with just some few tips?
pleaaase...:-)
Thank you very much
-jay
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>