Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

searching logs for 2 items

Status
Not open for further replies.

visvid

Technical User
Jun 3, 2002
131
GB
Hi ,

Wonder if anyone can help ? I am looking for a way of searching through a proxy log for two things...


userid and the web site, i have enclosed one line of the log, . As the logs are very large i was wondering if i should then send them to a file or can i output to screen


ibmproxy-cache.Jun142002:161.2.114.69 - <useridxxxx> [14/Jun/2002:08:16:44 +0000] &quot;GET HTTP/1.0&quot; 200 5217 &quot; &quot;Mozilla/4.0 (compatible; MSIE 5.5; Windows 95)&quot; &quot;MSPDom=2; MSPPre=xxxxxxx@hotmail.com; BrowserTest=Success%3f&quot;
 
This will print fields 3 and 7
using spaces or tabs as field delimiters.

# cat weblog.txt|awk '{print $3,$7}'
<useridxxxx>
OR to save to a file

# cat weblog.txt|awk '{print $3,$7}' > /tmp/weblog.out
<useridxxxx>
Robert Robert G. Jordan
Unix Sys Admin
Sleepy Hollow, Illinois U.S.A.
sh.gif


FREE Unix Scripts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top