bt707
asked on
perl print if and tabs
I need to print out a couple of parts of a certain line.
I need to fine all lines that contian "YSanchez4" and "summary=" from lines such as this one
[15/Nov/2006:22:10:34 +0000] usxsl069 cshttpd[14839]: General Notice: (SSL) : POST: /storeevents.wcap?id=5ph5r n0o0p0e5qm 0&calid=YS anchez4&dt start=2002 0101T12000 0&dtend=20 020101T010 000&summar y=New Year's Day&desc=&location=United States&icsClass=PUBLIC&isA llDay=1&ca tegories=H oliday&cha rset=UTF-8 &fmt-out=t ext/xml
I need to print out the summary= and the start and end time.
From this line I would get a print out of:
summary=New Year's Day 20020101T120000 20020101T010000
I'm getting the summary=... but when I try to add a few tabs and the start and end times I'm just getting a blank output,
can't figure out what I'm doing wrong here.
This is giving me the 1st part of what I need, need some help to get the start and end times.
perl -ne 'print "$1\n" if /(summary=.*)&desc=/'
Thanks,
I need to fine all lines that contian "YSanchez4" and "summary=" from lines such as this one
[15/Nov/2006:22:10:34 +0000] usxsl069 cshttpd[14839]: General Notice: (SSL) : POST: /storeevents.wcap?id=5ph5r
I need to print out the summary= and the start and end time.
From this line I would get a print out of:
summary=New Year's Day 20020101T120000 20020101T010000
I'm getting the summary=... but when I try to add a few tabs and the start and end times I'm just getting a blank output,
can't figure out what I'm doing wrong here.
This is giving me the 1st part of what I need, need some help to get the start and end times.
perl -ne 'print "$1\n" if /(summary=.*)&desc=/'
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks again!!!!