Hi, There was this example given to me:
while ( <LOGFILE> ) { my %extr = ( Start => '', IP => '', User => '', End => '', /^(Start|IP|User|End)=(.+)/mg ); print "Start:$extr{Start} IP:$extr{IP} User:$extr{User} End:$extr{End}\n\n"; } Reading my logfile in paragraph mode, it has these lines: Start: blablablah IP: blah blah blah User: blah blah blah End: blah blah blah Start: blablablah2 IP: blah blah blah2 User: blah blah blah2 End: blah blah blah2 What the above code does (specifically inside the hash is to assign the found pattern into the hash keys using this I guess... ... /^(Start|IP|User|End)=(.+)/mg ); ... I just wanted to know how fast did it happened.. Any idea? My new logfile contains these lines (each is one continuous line): Jul 1 01:06:33 my.hostname.com date=2006-07-01,time=01:06:46,device_id=FG200A2105403175,log_id=0101023002,type =event,subtype=ipsec,pri=notice,vd=root,loc_ip=192.168.0.4,loc_port=4500,rem_ip=192.168.1.14,rem_port=33552,out_if=wan1,vp n_tunnel=AxisGlobal,action=negotiate,status=success,msg="XAUTH user: ricky authentication successful" Jul 1 04:45:58 ppp130.dyn242.pacific.net.ph date=2006-07-01,time=04:46:09,device_id=FG200A2105403175,log_id=0101023002,type =event,subtype=ipsec,pri=notice,vd=root,loc_ip=192.168.0.5,loc_port=4500,rem_ip=192.16.3.97,rem_port=36036,out_if=wan1 ,vpn_tunnel=AxisGlobal,action=negotiate,status=success,msg="XAUTH user: susan authentication successful" Now, my goal is to adapt that code, particularly obtaining only Start, IP, User. However, those three targets are not anymore located at the beginning of a line. "Start" is the date=.time= combination, "IP" is found after rem_ip= "User" is found after "user: " I'm not really sure how to put my regexp inside my hash.. while ( <LOGFILE> ) { my %extr = ( Start => '', IP => '', User => '', /what should i put here??/mg ); print "Start:$extr{Start} IP:$extr{IP} User:$extr{User}\n\n"; } Hope you can help me.. thanks! -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>