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!

Questions..... 1

Status
Not open for further replies.

jo90

Programmer
Jun 19, 2002
30
GB
Hi all,

I have been assigned to look at a server log file & pick out various data - user ID etc. - problem is that it's an unformatted log file... any suggestions on how I can go about doing this, in the best manner ( awk etc )? Also I may use whatever tool I wish to do this ( ksh, csh, perl ), which of these would offer the best reporting style - perhaps the best formatting possibilities? I'm planning to display the data in JSP / ASP ( eventually... ) so any thoughts etc. on this would be great....

Thanks for your help,
Jo.
 
Post a sample of the log file and the output you want. CaKiwi
 
The log file is a series of entries such as this one;

Testdata server [26/Aug/2002:08:51:40] "111.111.111.111 "

I would like to extract the following information from the log file; server & ip address.

any ideas?

Thanks,
Joe.



 

nawk -f myLog.awk myLog.txt


#------------------------- myLog.awk-----------------------

{
gsub("\"", "", $4);
printf("%s %s\n", $1, $4);
}

$---------------------------------------------------------- vlad
+---------------------------+
|#include<disclaimer.h> |
+---------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top